
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
@gomomento/sdk-web
Advanced tools
Momento Cache is a fast, simple, pay-as-you-go caching solution without any of the operational overhead required by traditional caching solutions. This repo contains the source code for the Momento client library for JavaScript Web.
To get started with Momento you will need a Momento Auth Token. You can get one from the Momento Console.
The JavaScript Web SDK is available on npmjs: @gomomento/sdk-web
.
The web SDK is the best choice for client-side JavaScript applications, such as code that will run in a browser. For node.js server-side applications, check out the Momento Node.js SDK.
import {CacheClient, Configurations, CredentialProvider} from '@gomomento/sdk-web';
import {initJSDom} from './utils/jsdom';
async function main() {
// Because the Momento Web SDK is intended for use in a browser, we use the JSDom library to set up an environment
// that will allow us to use it in a node.js program.
initJSDom();
const cacheClient = new CacheClient({
configuration: Configurations.Laptop.v1(),
credentialProvider: CredentialProvider.fromEnvironmentVariable('MOMENTO_API_KEY'),
defaultTtlSeconds: 60,
});
await cacheClient.createCache('cache');
await cacheClient.set('cache', 'foo', 'FOO');
const getResponse = await cacheClient.get('cache', 'foo');
console.log(`Value: ${getResponse.value() ?? 'CACHE MISS OR ERROR'}`);
}
main().catch(e => {
throw e;
});
Documentation is available on the Momento Docs website.
Working example projects, with all required build configuration files, are available in the examples subdirectory.
If you are interested in contributing to the SDK, please see the CONTRIBUTING docs.
For more info, visit our website at https://gomomento.com!
FAQs
Client SDK for Momento services
The npm package @gomomento/sdk-web receives a total of 1,096 weekly downloads. As such, @gomomento/sdk-web popularity was classified as popular.
We found that @gomomento/sdk-web demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.