Read this in other languages: 日本語
- Node version 14 or higher is required
- To get started with Momento you will need a Momento Auth Token. You can get one from the Momento Console.
To run any of the examples you will need to install the dependencies once first:
npm installThis example demonstrates a basic set and get from a cache.
# Run example code
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> npm run basicExample Code: basic.ts
This example demonstrates several slightly more advanced concepts, including:
- creating and listing caches
- deleting a key
- issuing multiple concurrent get requests
- using the Middleware API to wrap requests
# Run example code
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> npm run advancedExample Code: advanced.ts
This example demonstrates how to use the dictionary data type.
# Run example code
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> npm run dictionaryExample Code: dictionary.ts
If you have questions or need help experimenting further, please reach out to us!