# The @sypnia/files package

> One npm package with subpaths for browsers, servers and React.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://files.docs.sypnia.com/tools/sdk/

For agents: @sypnia/files subpaths: /client (uploads direct+resumable, downloads, URLs, signed URLs with user session), /server (secret key, bucket management, policies, imports, S3 keys), /react (useUpload, FileDrop with progress/resume), CLI npx @sypnia/files; createFiles(url, {session}) where session = @sypnia/data client, getAccessToken() object or token function; ESM + types; Node 20+, browsers, Bun, Deno, React Native.

| Import                 | For                                                                                                      |
| ---------------------- | -------------------------------------------------------------------------------------------------------- |
| `@sypnia/files/client` | browsers and apps: uploads (direct and resumable), downloads, URLs, signed URLs, with the user's session |
| `@sypnia/files/server` | servers: the secret key, bucket management, policies, imports, S3 keys                                   |
| `@sypnia/files/react`  | `useUpload()` and `<FileDrop>` with progress and resume                                                  |
| `npx @sypnia/files`    | [the CLI](https://files.docs.sypnia.com/tools/cli)                                                       |

```ts
import { createFiles } from '@sypnia/files/client';
const files = createFiles('https://<ref>.files.sypnia.com', { session: sypnia.auth });
```

`session` accepts a `@sypnia/data` client, any object with `getAccessToken()`, or a function returning a token, so it works with other auth providers. ESM with types, Node 20+, browsers, Bun, Deno and React Native.
