> For the complete documentation index, see [llms.txt](https://docs.rulecube.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rulecube.com/v2.5/language-reference/userstore.md).

# UserStore

Collection of Rulecube User-related functions.

### Methods

#### invite

```javascript
invite(email: string, options: { accessExpirationDate?: Date | string, roles: string[] })
```

Creates a user with the given email and options.

**Parameters**

&#x20;   **email&#x20;*****string***

&#x20;       The email of the user.

&#x20;   **options&#x20;*****{ accessExpirationDate?: Date | string, roles: string\[] }***

&#x20;       The object containing the user options.

**Return type**

&#x20;   {userId: string, success: boolean, errorMessage?: string }

**Examples**

```javascript
UserStore.invite('user@example.org', { accessExpirationDate: TODAY().addDays(30), roles: ['WorkspaceUser'] })
```

#### getByEmail

```javascript
getByEmail(email: string)
```

Gets a user by email.

**Parameters**

&#x20;   **email&#x20;*****string***

&#x20;       The email of the user.

**Return type**

&#x20;   { \[key: string]: any; }

**Examples**

```javascript
UserStore.getByEmail('demo@example.org')
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rulecube.com/v2.5/language-reference/userstore.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
