Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dfinity/auth-client

Package Overview
Dependencies
Maintainers
11
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfinity/auth-client

JavaScript and TypeScript library to provide a simple integration with an IC Internet Identity

  • 0.8.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.9K
increased by105.23%
Maintainers
11
Weekly downloads
 
Created
Source

@dfinity/auth-client

Simple interface to get your web application authenticated with the Internet Identity Service

Visit the Dfinity Forum and SDK Documentation for more information and support building on the Internet Computer.

Additional API Documentation can be found here.


Installation

Using AuthClient:

npm i --save @dfinity/auth-client

In the browser:

import { AuthClient } from "@dfinity/auth-client";

To get started with auth client, run

const authClient = await AuthClient.create();

The authClient can log in with

authClient.login({
  onSuccess: async () => {
    // authClient now has an identity
  },
});

It opens an identity.ic0.app window, saves your delegation to localStorage, and then sets you up with an identity.

Then, you can use that identity to make authenticated calls using the @dfinity/agent Actor.

const identity = await authClient.getIdentity();
const actor = Actor.createActor(idlFactory, {
  agent: new HttpAgent({
    identity,
  }),
  canisterId,
});

Note: depends on @dfinity/agent, @dfinity/authentication, and @dfinity/identity.

Keywords

FAQs

Package last updated on 03 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc