Announcing our open source plans for the Inngest event-driven queue
Join our Discord
Sign up for free

Secrets

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:

js
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 (?)",
[event.user.email, event.data.signup_reason]
);
return result;
}