# Install the SDK

> The @vimine/sdk package, its three entry points, the requirements.

URL: https://developers.vimine.network/en/start/install/

The official SDK is **`@vimine/sdk`**: TypeScript, ESM, **zero dependencies** (it uses `fetch` and
WebCrypto). The browser entry point weighs about 7 kB compressed.

<Tabs syncKey="pkg">
    <TabItem label="npm">
        ```sh
        npm install @vimine/sdk
        ```
    </TabItem>
    <TabItem label="pnpm">
        ```sh
        pnpm add @vimine/sdk
        ```
    </TabItem>
    <TabItem label="yarn">
        ```sh
        yarn add @vimine/sdk
        ```
    </TabItem>
</Tabs>

## Entry points

| Import | What it contains | Where |
|---|---|---|
| `@vimine/sdk` | `Vimine` (Sign in with Vimine + member API), `publicApi`, `VimineError`, the types | browser; Node too with a storage of your own |
| `@vimine/sdk/react` | `VimineProvider`, `useVimine`, `SignInButton` | React ≥ 18 (optional peer dependency) |
| `@vimine/sdk/server` | `VimineServer` (confidential clients, `client_credentials`, sandbox) | Node ≥ 18 — never in a browser |

```js title="browser"
import { Vimine, publicApi, VimineError } from '@vimine/sdk';
```

```js title="server"
import { VimineServer } from '@vimine/sdk/server';
```

```jsx title="React"
import { VimineProvider, useVimine, SignInButton } from '@vimine/sdk/react';
```

## Requirements

- **Browser**: `fetch`, `crypto.subtle` (WebCrypto) and `sessionStorage`/`localStorage` — every modern
  browser. Pages must be served over `https` (or `http://localhost` in development): WebCrypto is not
  available on insecure origins.
- **Node**: 18 or later (native `fetch` and `globalThis.crypto`).
- **Bundler**: any (Vite, webpack, esbuild, …) or `<script type="module">` with a bundle of your own. The
  package is ESM only.
- **TypeScript**: types are included; no `@types/*` to add.

## The first sign-in

```js title="app.js"
import { Vimine } from '@vimine/sdk';

const vimine = new Vimine({
    clientId: 'vmc_…',                                          // from the Developers console
    redirectUri: 'https://www.example.org/vimine/callback',  // registered for the client
    scopes: ['profile:read', 'membership:read']
});

document.querySelector('#sign-in').addEventListener('click', () => vimine.signIn());
```

```js title="callback.js"
const result = await vimine.handleRedirect();   // exchanges the code, stores the session
if (result) {
    const me = await vimine.me.get();
    console.log(`Hello ${me.first_name}`);
}
```

Continue with [Sign in with Vimine](https://developers.vimine.network/en/guides/sign-in/) for the whole flow, the session and signing out.
