{"id":22004559,"url":"https://github.com/slicknode/slicknode-apollo-link","last_synced_at":"2026-05-01T17:31:17.194Z","repository":{"id":32979091,"uuid":"148491346","full_name":"slicknode/slicknode-apollo-link","owner":"slicknode","description":"Slicknode network link component for apollo-client","archived":false,"fork":false,"pushed_at":"2023-03-04T04:12:31.000Z","size":258,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-01T13:36:29.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slicknode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-12T14:13:15.000Z","updated_at":"2021-07-14T19:23:55.000Z","dependencies_parsed_at":"2024-11-30T03:10:30.195Z","dependency_job_id":null,"html_url":"https://github.com/slicknode/slicknode-apollo-link","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/slicknode/slicknode-apollo-link","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slicknode%2Fslicknode-apollo-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slicknode%2Fslicknode-apollo-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slicknode%2Fslicknode-apollo-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slicknode%2Fslicknode-apollo-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slicknode","download_url":"https://codeload.github.com/slicknode/slicknode-apollo-link/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slicknode%2Fslicknode-apollo-link/sbom","scorecard":{"id":831558,"data":{"date":"2025-08-11","repo":{"name":"github.com/slicknode/slicknode-apollo-link","commit":"35b768d8e887739c3b2fb51ed07eca8e3cbef2a5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"20 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T17:55:00.619Z","repository_id":32979091,"created_at":"2025-08-23T17:55:00.619Z","updated_at":"2025-08-23T17:55:00.619Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32506911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T00:16:28.885Z","updated_at":"2026-05-01T17:31:17.174Z","avatar_url":"https://github.com/slicknode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slicknode Apollo Link\n\n![CircleCI](https://img.shields.io/circleci/build/github/slicknode/slicknode-apollo-link)\n![npm](https://img.shields.io/npm/v/slicknode-apollo-link)\n\nApolloLink component that automatically sets authentication headers for GraphQL requests via the [@apollo/client](https://www.apollographql.com/client). It stores the access and refresh tokens in a store (for example InMemory, localStorage, sessionStorage etc.) and keeps track of expiration times. \nIf auth tokens expire, they are automatically refreshed in the background when a request is issued, without interruption to the user. Can be combined with any of the available [apollo links](https://www.apollographql.com/docs/link/#linkslist).\n\nWorks with any GraphQL API that implements auth mutations as outlined in the [Slicknode documentation](https://slicknode.com/docs/auth/authentication/).\n\n## Installation\n\nInstall the [slicknode-apollo-link](https://github.com/slicknode/slicknode-apollo-link) npm package: \n\n    npm install slicknode-apollo-link\n\nSlicknode Apollo Link has peer dependencies to `graphql` and `@apollo/client` which you should already have installed when you are using the [Apollo Client](https://www.apollographql.com/client).\n\n## Usage\n\nThis is a minimal example to create an instance of an apollo client with SlicknodeLink. Refer to the documentation of the\n[apollo-client](https://www.apollographql.com/client) to learn how to use and customize it: \n\n```javascript\nimport {\n  ApolloClient,\n  InMemoryCache,\n  HttpLink,\n  ApolloLink,\n} from '@apollo/client';\nimport SlicknodeLink from 'slicknode-apollo-link';\n\nconst slicknodeLink = new SlicknodeLink({\n  debug: true, // Writes auth debug info to console, disable in production\n});\n\nconst SLICKNODE_ENDPOINT =\n  'https://api.us-east-1.aws.slicknode.com/v1/your-project';\n\nconst client = new ApolloClient({\n  cache: new InMemoryCache(),\n  // Create link chain\n  link: ApolloLink.from([\n    // Add Slicknode link before HttpLink to add auth headers\n    slicknodeLink,\n\n    // ...More links for error handling etc...\n\n    // Network link to make HTTP requests to the API\n    new HttpLink({\n      uri: SLICKNODE_ENDPOINT,\n      credentials: 'same-origin',\n      headers: {\n        // Uncomment to enable preview mode:\n        // 'X-Slicknode-Preview': '1',\n        // Uncomment to set default locale:\n        // 'X-Slicknode-Locale': 'en-US',\n      },\n    }),\n  ]),\n});\n```\n\n### Authentication\n\nTo authenticate the client on the server and obtain an auth token set, you can execute any mutation \nthat returns such data. By adding the directive `@authenticate` to the mutation, the `SlicknodeLink`\nautomatically picks up the tokens, stores them on the client and adds the required authentication headers\nto subsequent requests. \n\nMake sure that the module with the login mutation is installed and deployed to your Slicknode server. See the list of\n[available auth modules](https://slicknode.com/docs/auth/authentication/#authentication-modules) for details.\n\nFor example:\n\n```javascript\nimport { gql } from '@apollo/client';\n\nclient.query(gql`\n  mutation LoginUser {\n    loginEmailPassword(input: {\n      email: \"email@example.com\",\n      password: \"xyz123\"\n    }) @authenticate {\n      accessToken\n      refreshToken\n      accessTokenLifetime\n      refreshTokenLifetime\n    }\n  }`\n)\n  .then(result =\u003e {\n    console.log('');\n  })\n  .catch(err =\u003e {\n    console.log('Something went wrong: ', err.message);\n  });\n```\n\n\n### Logout\n\nTo log the user out, you can execute the `logoutUser` mutation. This automatically deletes the auth tokens\nfrom the store when successful and invalidates the refresh token no the server: \n\n```javascript\nclient.query({\n  query: gql`mutation LogoutUser($token: String) {\n    logoutUser(input: {refreshToken: $token}) {\n      success\n    }\n  }`,\n  variables: {\n    // Get the current refreshToken from the SlicknodeLink instance to invalidate it on the server\n    token: slicknodeLink.getRefreshToken()\n  }\n)\n  .then(result =\u003e {\n    console.log('Login successful', result.data.logoutUser);\n  })\n  .catch(err =\u003e {\n    console.log('Something went wrong: ', err.message);\n  });\n```\n\nYou might want to clear the apollo client cache after logging a user out to not accidentally expose private data. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslicknode%2Fslicknode-apollo-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslicknode%2Fslicknode-apollo-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslicknode%2Fslicknode-apollo-link/lists"}