
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
slicknode-apollo
Advanced tools
Apollo client with recommended defaults and built in authentication to work with Slicknode GraphQL servers.
Apollo client with recommended defaults and built in authentication to work with Slicknode GraphQL servers.
Install the client and required packages via npm:
npm install slicknode-apollo graphql --save
With the dependencies installed, you can create an instance of the ApolloClient with Slicknode
support enabled. You only need the endpoint of your Slicknode GraphQL server that you can
get via slicknode endpoint
from your project.
import ApolloClient from 'slicknode-apollo';
const client = new ApolloClient({
endpoint: 'https://myproject.slicknode.com'
});
This client is a regular ApolloClient instance with the data fetching logic for Slicknode
preconfigured. Authentication headers are automatically added, when the accessToken
expires
and a query is fetched via the client, it is automatically refreshed in the background
without requiring any interruption to the user.
You can use any of the available Authenticators to obtain a set of auth tokens and their expiration
times. We'll use the slicknode-auth-email-password
authenticator as an example. For more details
check the documentation of the authenticators.
Always make sure that you have the module installed in your Slicknode server, otherwise the required mutations are not available.
Install the dependencies via npm
npm install slicknode-auth-email-password --save
Then in your application you can authenticate the user:
import loginEmailPassword from 'slicknode-auth-email-password';
client.authenticate(loginEmailPassword('email@example.com', 'password123'))
.then(() => {
console.log('Login successful, redirect to user home page');
})
.catch(err => {
console.log('Something went wrong, try again: ' + err.message);
});
To delete all the access and refresh tokens from the builtin token storage, simply log the user out:
client.logout()
.then(() => {
console.log('Login successful');
})
.catch(err => {
console.log('Something went wrong: ' + err.message);
});
FAQs
Apollo client with recommended defaults and built in authentication to work with Slicknode GraphQL servers.
The npm package slicknode-apollo receives a total of 0 weekly downloads. As such, slicknode-apollo popularity was classified as not popular.
We found that slicknode-apollo demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.