I'm trying to set up turnstile app check on a Nuxt3 project. Already installed the extension, function is online and working. But it is never called by the plugin. HTTP_ENDPOINT is correct, but i see in the docs this format:
'${function:function-name.url}'
Made me wonder if i'm passing the http endpoint correctly.
import { CloudflareProviderOptions } from '@cloudflare/turnstile-firebase-app-check'
import { initializeAppCheck, CustomProvider } from 'firebase/app-check'
import { getFunctions } from 'firebase/functions'
export default defineNuxtPlugin((nuxtApp) => {
if (!process.client) return
const firebaseApp = nuxtApp.vueApp.$nuxt.$firebaseApp
const turnstileSiteKey = process.env.TURNSTILE_KEY
const region = getFunctions(firebaseApp).region
const HTTP_ENDPOINT = `https://${region}-${firebaseApp.options.projectId}.cloudfunctions.net/ext-cloudflare-turnstile-app-check-provider-tokenExchange`
const cpo = new CloudflareProviderOptions(HTTP_ENDPOINT, turnstileSiteKey)
const provider = new CustomProvider(cpo)
initializeAppCheck(firebaseApp, { provider })
})
Hey guys,
I'm trying to set up turnstile app check on a Nuxt3 project. Already installed the extension, function is online and working. But it is never called by the plugin. HTTP_ENDPOINT is correct, but i see in the docs this format:
'${function:function-name.url}'
Made me wonder if i'm passing the http endpoint correctly.