Appearance
Creating an Event Key โ
โEvent Keysโ are unique keys that allow applications to send (aka publish) events to Inngest. When using Event Keys with the Inngest SDK, you can configure the Inngest client in 2 ways:
- Setting the key as an
INNGEST_EVENT_KEYenvironment variable in your application* - Passing the key as an argument
jsx
// Recommended: Set an INNGEST_EVENT_KEY environment variable for automatic configuration:
const inngest = new Inngest({ name: "Your app name" });
// Or you can pass the eventKey explicitly to the constructor:
const inngest = new Inngest({ name: "Your app name", eventKey: "xyz..." });
// With the Event Key, you're now ready to send data:
await inngest.send({ ... })* Our Vercel integration automatically sets the INNGEST_EVENT_KEY as an environment variable for you
Callout: ๐ Event Keys should be unique to a given environment (e.g. production, branch environments) and a specific application (your API, your mobile app, etc.). Keeping keys separated by application makes it easier to manage keys and rotate them when necessary.
Callout: ๐ Securing Event Keys - As Event Keys are used to send data to your Inngest environment, you should take precautions to secure your keys. Avoid storing them in source code and store the keys as secrets in your chosen platform when possible.
Creating a new Event Key โ
From the Inngest Cloud dashboard, Event Keys are listed in the "Manage" tab:
- Next to the environment drop down, click the key icon, then "Event keys" (direct link)
- Click the "+ Create Event Key" button at the top right
- Update the Event Key's name to something descriptive and click "Save changes"
- Copy the newly created key using the โCopyโ button:
๐ You can now use this event key with the Inngest SDK to send events directly from any codebase. You can also:
- Rename your event key at any time using the โNameโ field so you and your team can identify it later
- Delete the event key when your key is no longer needed
- Filter events by name or IP addresses for increased control and security
Callout: โ ๏ธ While it is possible to use Event Keys to send events from the browser, this practice presents risks as anyone inspecting your client side code will be able to read your key and send events to your Inngest environment. If you'd like to send events from the client, we recommend creating an API endpoint or edge function to proxy the sending of events.