open-index/open-npm huggingface dataset:
npm package: @slashid/react
Description: React SDK for the /id platform
Latest version: 1.34.0

![SlashID React SDK](https://raw.githubusercontent.com/slashid/javascript/main/packages/react/slashid_react_banner.png)

![npm](https://img.shields.io/npm/v/@slashid/react)
![build](https://github.com/slashid/javascript/actions/workflows/ci.yml/badge.svg)

## Documentation

Check out our [developer docs](https://developer.slashid.dev/) for guides and API documentation. You can also check out the demo on CodeSandbox:

[![Try on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/hopeful-austin-486cco?fontsize=14&hidenavigation=1&theme=dark)

## Setup

### Prerequisites

Your organization needs to [sign up](https://slashid.dev/request-access) with `/id` to get access to the core SDK and an organization ID.

Your environment should have the following dependencies installed:

- `node.js` => `v16+`
- `react` => `v16+`
- `@slashid/slashid` => `v1.8+`

### Installation

After obtaining your organization ID, log in to `npm` and install the package:

```
npm install @slashid/react
```

### Basic Usage

Primary way of communicating with the `/id` APIs is by using the provided `useSlashID` hook. In order to do so, your app needs to be wrapped in the `SlashIDProvider`. This provider requires you to pass in the organization ID you received from `/id` as the value of the `oid` prop.

```jsx
import { SlashIDProvider } from "@slashid/react";
import React from "react";
import ReactDOM from "react-dom/client";

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
  <React.StrictMode>
    <SlashIDProvider oid="ORGANIZATION_ID">
      <App />
    </SlashIDProvider>
  </React.StrictMode>
);

function App() {
    const { user, logIn } = useSlashID();

    return (
      <>
        <button
          onClick={() =>
            logIn({
              handle: {
                type: "email_address",
                value: "example@email.com",
              },
              factor: { method: "email_link" },
            })
          }
        >
          Log in
        </button>
        <div>
          <code>{user}</code>
        </div>
      </>
  );
}
```

Once the `logIn` function resolves, your component will render again with the newly logged-in `user` object.
npm package: @slashid/shopify-sdk
Description: Shopify SDK allows you to seamlessly authenticate your customers to Shopify with SlashID. This is done by exchanging a SlashID user token for a Shopify Multipass token.
Latest version: 0.1.0

# SlashID Shopify SDK

Shopify SDK allows you to seamlessly authenticate your customers to Shopify with SlashID. This is done by exchanging a SlashID user token for a Shopify Multipass token.

[Read the docs](https://developer.slashid.dev/docs/integrations/shopify-app)

## Installation

```bash
npm install @slashid/shopify-sdk
```

## Setup

1. Create a [SlashID](https://slashid.dev) account
1. Follow the integration guide on the [SlashID developer portal](https://developer.slashid.dev/docs/integrations/shopify-app)
1. Make sure you have the following information:
   - `storeURL` - the URL of your Shopify store
   - `externalCredentialsId` - the ID of the external credentials you created in the SlashID developer portal
   - `slashIdToken` - the token you get by logging in with SlashID

## Usage

```js
import { ShopifySDK } from "@slashid/shopify-sdk";

const storeURL = "https://mystore.myshopify.com";
const slashIdToken = "<get the token by logging in with SlashID>";
const externalCredentialsId = "<store Shopify secrets safely with SlashID>";

let shopifySDK = new ShopifySDK({ storeURL });

// get a customer access token to use with the Shopify Storefront API
let customerAccessToken = await shopifySDK.getCustomerAccessToken(
  slashIdToken,
  externalCredentialsId
);

// navigate to the Shopify store without having to login again
let multipassToken = await shopifySDK.getMultipassToken(
  slashIdToken,
  externalCredentialsId
);
shopifySDK.redirectToShopify(multipassToken);

// optionally pass a return_to field to be used in Multipass
let multipassTokenWithReturnTo = await shopifySDK.getMultipassToken(
  slashIdToken,
  externalCredentialsId,
  multipassFields: {
    return_to: "https://mystore.myshopify.com/cart",
  }
);

// Shopify will redirect to the return_to URL after login
shopifySDK.redirectToShopify(multipassToken);
```