# invited

> Basic Invite Handling API and Package

Latest version **0.0.8** (published 2022-02-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install invited
pnpm add invited
yarn add invited
bun add invited
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2022-02-01 |
| First published | 2021-09-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 392.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | cryogenicplanet |

## Links

- npm: https://www.npmjs.com/package/invited
- npm.io page: https://npm.io/package/invited

## Dependencies (2)

- [@heroicons/react](https://npm.io/package/@heroicons/react.md) ^1.0.4
- [@headlessui/react](https://npm.io/package/@headlessui/react.md) ^1.4.1

## Recent versions

- 0.0.8 (latest) — 2022-02-01
- 0.0.7 — 2022-02-01
- 0.0.6 — 2022-02-01
- 0.0.5 — 2021-12-02
- 0.0.4 — 2021-11-11
- 0.0.3-a — 2021-09-29
- 0.0.3 — 2021-09-29
- 0.0.2 — 2021-09-29
- 0.0.1 — 2021-09-29
- 0.0.0 — 2021-09-29

## README

# Invited API

Basic Invite Handling API and Package


## Usage

1. Go to [invited.vercel.app](https://invited.vercel.app) and create an account
2. Create a new project, and get the `apiToken`

**You have two choices, you can use the api directly or use the client package**

## [API Docs](https://invited.vercel.app/docs/api)

## [Client Docs](https://invited.vercel.app/docs/client)


### Install
```
yarn add invited axios
```

### Basic Usage

```ts

const invited = new Invited('apiTokenHere')

await invited.verify('example@example.com')

```


### Create Invite

```ts
const invite = await invited.create()
// https://invited.vercel.app/[slug]

// Can modify this URL in the constructor
const invited = new Invited('apiTokenHere', {baseUrl : "YOUR WEBSITE"})

```

### Consume Invite

```ts
await invited.consume('example@example.com','slug')
```


### Options

You can set any of the following options in the constructor

```ts
export type Options = {
  modal?: boolean
  baseUrl?: string
  darkMode?: boolean
  homeUrl?: string
  redirectUrl?: string
}
```

| Option | Default | Description | 
| --- | --- |----------- |
| modal | `true` | If a modal should show if the user is not invited
| darkMode | `true` | If the modal should be dark mode or not
| baseUrl | `invited.vercel.app` | The base url to which the slug is added
| homeUrl | `/` | THe url to return too on the modal
| redirectUrl | `undefined` | The url to redirect too after consume an invite

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