Skip to content
  • Integrations
  • Third-party tools

Kinde and edge worker services

Kinde works seamlessly with edge worker services and providers, enabling you to deploy authentication at the edge for improved performance and lower latency. We have tested and provide guides for the following platforms:

  • Cloudflare Workers - Serverless edge runtime
  • Next.js Edge Runtime - Edge functions for Next.js applications
  • Nuxt on Vercel - Edge functions for Nuxt applications
  • Deno Deploy - Edge runtime for Deno applications

Choose your integration path

Link to this section

The approach you take depends on your use case:

Deploying a Next.js application to Cloudflare Workers

Link to this section

If you’re deploying a Next.js application with Kinde authentication to Cloudflare Workers, follow our comprehensive deployment guide:

Deploy a Kinde app on Cloudflare Workers →

This guide covers:

  • Setting up the OpenNext adapter for Cloudflare Workers
  • Configuring wrangler.toml with proper compatibility flags
  • Environment variable setup for Cloudflare Workers
  • Callback URL configuration
  • Troubleshooting common deployment issues

Verifying JWTs in Cloudflare Workers

Link to this section

If you need to verify JWT tokens in Cloudflare Workers (for API protection or custom authentication flows), use our JWT verification guide:

Verifying JWTs in Cloudflare Workers →

This guide covers:

  • Using cloudflare-worker-jwt library
  • Using jose library for JWT verification
  • Fetching JWKS from Kinde
  • Implementing token verification at the edge

Other edge platforms

Link to this section

For other edge platforms, you’ll need to handle JWT implementation (generate & validate JWT tokens) without relying on Node.js-specific libraries. Here are some general considerations:

Next.js Edge Runtime

Link to this section

Next.js Edge Runtime works well with Kinde’s Next.js SDK. When using API routes with export const runtime = 'edge', ensure you:

  • Use server-side authentication methods from the Kinde Next.js SDK
  • Avoid using KindeProvider in edge runtime contexts
  • Handle environment variables appropriately for your deployment platform

For detailed Next.js integration, see the Next.js SDK documentation.

Nuxt on Vercel

Link to this section

When deploying Nuxt applications to Vercel with edge functions, follow Vercel’s Nuxt on Vercel guide and use Kinde’s server-side authentication patterns.

For Deno Deploy, you’ll need to implement JWT verification manually using Deno-compatible libraries. Consider using the jose library which works across different JavaScript runtimes including Deno.

Key considerations for edge workers

Link to this section
  • Environment variables: Edge workers may require different configuration methods (e.g., wrangler.toml for Cloudflare Workers vs .env.local for standard deployments)
  • JWT libraries: Standard Node.js JWT libraries may not work. Use edge-compatible libraries like cloudflare-worker-jwt or jose
  • SDK limitations: Some SDK features may not be available in edge environments. Use server-side authentication patterns instead of client-side providers where possible
  • Cookie handling: Ensure cookies are properly configured for your edge platform’s requirements
  1. Choose your platform from the options above
  2. Follow the specific guide for your use case (Cloudflare Workers deployment or JWT verification)
  3. Configure your Kinde application with the correct callback URLs for your edge deployment
  4. Test locally before deploying to production

For platform-specific questions, refer to your edge provider’s documentation or our detailed guides linked above.