# @descope/core-js-sdk

> Descope JavaScript core SDK

Latest version **2.73.0** (published 2026-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @descope/core-js-sdk
pnpm add @descope/core-js-sdk
yarn add @descope/core-js-sdk
bun add @descope/core-js-sdk
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.73.0 |
| Published | 2026-09-17 |
| First published | 2022-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 347.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 69 |
| Author | Descope Team |
| Maintainers | omercnet, barsdescope, nirgur, tom-descope, asafshen |
| Keywords | descope, authentication |

## Links

- npm: https://www.npmjs.com/package/@descope/core-js-sdk
- Repository: https://github.com/descope/descope-js
- Issues: https://github.com/descope/descope-js/issues
- npm.io page: https://npm.io/package/@descope/core-js-sdk

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) 2.8.1
- [jwt-decode](https://npm.io/package/jwt-decode.md) 4.0.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 2.73.0 (latest) — 2026-09-17
- 0.0.0-next-53a292d5-20260917 (next) — 2026-09-17
- 1.9.2-alpha.0 (alpha) — 2023-10-12
- 2.72.0 — 2026-09-16
- 2.71.0 — 2026-09-10
- 0.0.0-next-05188302-20260910 — 2026-09-10
- 2.70.1 — 2026-09-08
- 0.0.0-next-c3fa1ee9-20260904 — 2026-09-04
- 2.70.0 — 2026-08-24
- 2.69.0 — 2026-08-17
- 2.68.0 — 2026-08-10
- 0.0.0-next-ce182e96-20260810 — 2026-08-10
- 2.67.1 — 2026-08-09
- 2.67.0 — 2026-07-12
- 2.66.0 — 2026-06-28
- … 326 more at https://npm.io/package/@descope/core-js-sdk/versions

## README

# @descope/core-js-sdk

Descope JavaScript core SDK

## Usage

### Install the package

```bash
npm install @descope/core-js-sdk
```

### Use it

```js
import createSdk from '@descope/core-js-sdk';

const projectId = '<project-id>';

const sdk = createSdk({ projectId });

const loginId = 'loginId';

sdk.otp.signIn.email(loginId);
```

## Enchanted Link over SMS

The enchanted link can be delivered by SMS instead of email, using `signInWithPhone`,
`signUpWithPhone`, `signUpOrInWithPhone` and `update.phone.sms`. The login ID is a phone number, and
the response is a `PhoneEnchantedLinkResponse`, which carries `maskedPhone` instead of `maskedEmail`.
Unlike the email message, the text message contains only the correct link, so the user has nothing
to choose. Polling with `waitForSession` and verification are unchanged.

```js
const { data } = await sdk.enchantedLink.signUpOrInWithPhone(
  '+11234567890',
  'https://myapp.com/verify-enchanted-link',
);
const jwt = await sdk.enchantedLink.waitForSession(data.pendingRef);
```

## Outbound Connect

Connect to outbound applications (e.g., Google, Microsoft) to access user data from external services.

### Basic Usage

```js
// Connect to an outbound application
const response = await sdk.outbound.connect('app-id', {
  redirectUrl: 'https://your-app.com/callback',
  scopes: ['email', 'profile'],
});

// Redirect user to the returned URL
window.location.href = response.data.url;
```

### Using External Identifier

You can pass an external identifier to map the outbound connection to an external user:

```js
const response = await sdk.outbound.connect('app-id', {
  redirectUrl: 'https://your-app.com/callback',
  scopes: ['email', 'profile'],
  externalIdentifier: 'external-user-id-123',
});
```

### Tenant-Specific Connections

For multi-tenant applications, you can specify tenant-level connections:

```js
const response = await sdk.outbound.connect(
  'app-id',
  {
    redirectUrl: 'https://your-app.com/callback',
    scopes: ['email', 'profile'],
    externalIdentifier: 'external-user-id-123',
    tenantId: 'tenant-123',
    tenantLevel: true,
  },
  'user-session-token',
);
```

---
_Source: https://npm.io/package/@descope/core-js-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
