- Node version 14 or higher is required
- To use the examples, you will need a Momento API key. You can generate one using the Momento Console.
The examples will utilize your API key via the environment variable
MOMENTO_API_KEY
you set. - The examples use a cache
model-cache
that you will need to create in your Momento account. You can create them on the console as well!- As an alternative, you can pass a flag while instantiating our caching wrapper, which the examples already do to make it easy for you.
To run any of the examples you will need to install the dependencies once first:
npm install
This example demonstrates insert and select from Momento or your underlying database (on a cache Miss).
# Run example code
MOMENTO_API_KEY=<YOUR API KEY> npm run basic
Example Code: basic.ts