stefanprokopdev / verify-apple-id-token

Verify the Apple id token on the server side.
MIT License
80 stars 16 forks source link
apple apple-idtoken id idtoken login signin signinwithapple token verification verify

Build Status Publish Status npm version codecov

Verify Apple idToken

Installation

npm install verify-apple-id-token

Usage

Typescript

import verifyAppleToken from "verify-apple-id-token";

const jwtClaims = await verifyAppleToken({
  idToken: "yourIdToken",
  clientId: "yourAppleClientId", // or ["app1ClientId", "app2ClientId"]
  nonce: "nonce", // optional
});

jwtClaims.email; // get email of the user

Javascript

const verifyAppleToken = require("verify-apple-id-token").default;

const jwtClaims = await verifyAppleToken({
  idToken: "yourIdToken",
  clientId: "yourAppleClientId",  // or ["app1ClientId", "app2ClientId"]
  nonce: "nonce", // optional
});

Contribution

Thank you for your interest in contributing to verify-apple-id-token! Please see the CONTRIBUTING.md to learn how to do it!

License

MIT