Details
Overview
Momento is the world's first truly serverless caching service. It provides instant elasticity, scale-to-zero capability, and blazing-fast performance. Gone are the days where you need to choose, manage, and provision capacity.
Instructions
This integration will allow you connect your caches to your Vercel project(s).
The required information to connect to Momento from your Vercel project(s) can be found in the following environment variables
MOMENTO_API_KEYMOMENTO_HTTP_ENDPOINT
You can interact with your cache through the Momento SDK, or you can use the MOMENTO_HTTP_ENDPOINT variable to interact with the Momento HTTP API
Here is an example using our nodejs SDK:
const cacheName = "vercel-cache"; // change this if you want to use a different cacheconst momento = new CacheClient({ configuration: Configurations.Laptop.v1(), defaultTtlSeconds: 60, credentialProvider: CredentialProvider.fromEnvironmentVariable({ environmentVariableName: 'MOMENTO_API_KEY', }),});
await momento.set(cacheName, "key", "value");await momento.get(cacheName, "key");