Skip to content
Avatar of vercelvercel/examples

Using Crypto in Edge Middleware and Edge Functions

Learn to utilize the crypto Web APIs at the edge.

Edge Functions Crypto

Crypto

In this example, you'll see how you can utilize the crypto Web APIs with Edge Middleware and Edge Functions.

Working example: crypto.vercel.sh

Includes:

  • crypto.randomUUID
  • crypto.getRandomValues
  • Encryption with crypto.subtle
  • Decryption with crypto.subtle

Demo

https://edge-functions-crypto.vercel.app

How to Use

You can choose from one of the following two methods to use this repository:

One-Click Deploy

Deploy the example using Vercel:

Clone and Deploy

Execute create-next-app with pnpm to bootstrap the example:

pnpm create next-app --example https://github.com/vercel/examples/tree/main/edge-middleware/crypto crypto

Next, run Next.js in development mode:

pnpm dev

Deploy it to the cloud with Vercel (Documentation).

Edge Functions Crypto
Avatar of vercelvercel/examples

Using Crypto in Edge Middleware and Edge Functions

Learn to utilize the crypto Web APIs at the edge.

Crypto

In this example, you'll see how you can utilize the crypto Web APIs with Edge Middleware and Edge Functions.

Working example: crypto.vercel.sh

Includes:

  • crypto.randomUUID
  • crypto.getRandomValues
  • Encryption with crypto.subtle
  • Decryption with crypto.subtle

Demo

https://edge-functions-crypto.vercel.app

How to Use

You can choose from one of the following two methods to use this repository:

One-Click Deploy

Deploy the example using Vercel:

Clone and Deploy

Execute create-next-app with pnpm to bootstrap the example:

pnpm create next-app --example https://github.com/vercel/examples/tree/main/edge-middleware/crypto crypto

Next, run Next.js in development mode:

pnpm dev

Deploy it to the cloud with Vercel (Documentation).

Unleash New Possibilities

Deploy your app on Vercel and unlock its full potential