apollo-link-token
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta.1 • Public • Published

title: Token Link

Purpose

An Apollo Link to setting auth token to headers before making a request.

Installation

npm install apollo-link-token --save

or Yarn yarn add apollo-link-token

Usage

import { TokenLink } from "apollo-link-token";

const link = new TokenLink({
  getValidTokenAsync: async () => {
    return null;
  },
});

Options

  • getValidTokenAsync: a async function call in every request to receving token from storage. You can do some stuff: check expires and refresh if need.

Readme

Keywords

none

Package Sidebar

Install

npm i apollo-link-token

Weekly Downloads

3

Version

1.0.0-beta.1

License

MIT

Last publish

Collaborators

  • giautm