Announcing our new Vercel integration
Join our Discord
Sign up for free


Secrets are passed as environment variables to your functions in production. For example, if you were writing a Node.js function that used a DATABASE_URL secret to connect to a PlanetScale database, you would reference it just like any other environment variable:

const mysql = require("mysql2/promise");
async function main({ event }) {
const connection = await mysql.createConnection(process.env.DATABASE_URL);
const [result] = await connection.execute(
"INSERT INTO signups (email, signup_reason) VALUES (?)",
return result;