Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
how to get appCheck token in getStaticProps next js

I need to pass the appCheck token to my request in getStaticProps but when I use getToken( method it throws the error below: AppCheck is being used before activate() is called for FirebaseApp [DEFAULT] Is there any way to use appCheck token in serve Side Rendering?

firebase.js:

if (!firebase.apps.length) {
  firebase.initializeApp(firebaseConfig);
  const appCheck = firebase.appCheck();
  appCheck.activate(process.env.NEXT_PUBLIC_APP_CHECK_SITE_KEY, true);
    });
}

index.js:

export const getStaticProps = async () => {
let token
appCheck
    .getToken(/* forceRefresh= */ false)
    .then(async (rs) => {
      token = rs.token;
    })
    .catch((err) => {
      console.log(err);
    });
  const places = await getAllPlaces(token);

  return { props: { places }, revalidate: 60 };
};```
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!