> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superalign.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

There are various ways to configure and personalize your SuperAlign instance to better suit your needs. In this section you will find all the information you need about settings and options you can configure to get what you need out of SuperAlign.

## Initialization

1. Run `pureml init` command to setup the puremlconfig.yml file.
2. Since you want to self-host, enter `Y` in CLI promt asking you whether you want to continue self-hosting or not.
3. Give the self-hosted backend and frontend url.
   > If no changes are made to ports or domains (using localhost) then go ahead and click 'enter' to use the default values.

## Create account

If you're new to SuperAlign, you'll need to sign up for an account before you can start using the platform. CLI supports you to signup. You can do this using the `pureml` command line utility:

<CodeGroup>
  ```bash >_ Terminal theme={null}
  pureml auth signup
  ```
</CodeGroup>

This command will prompt you to enter your email, user handle, name, and password to create your SuperAlign account. Once you register your details successfully, you will receive a verification mail on registered email Id to verify and proceed for login.

## Sign In to continue

If you already have a SuperAlign account, you can log in using below method:

The `pureml` command line utility:

<CodeGroup>
  ```bash >_ Terminal theme={null}
  pureml auth login
  ```
</CodeGroup>

This command will prompt you to SuperAlign UI. Add your sign in credentials and you should see successful login on entering correct credentials.

<Info>
  Go to `https://app.superalign.ai/auth/sign-in` to sign in through your sign in
  credentials.
</Info>

Once you're logged in, you'll be able to view your datasets, models, and other assets using the SuperAlign platform.

### Using API Token

Go to API Token section in user account settings page on SuperAlign UI here (or using your self-hosted URL if any).

<img src="https://mintlify.s3.us-west-1.amazonaws.com/pureml/self-hosting/images/Settings_APITokenList_Updated.png" alt="ListAPIToken" />

Create a new API Token. Copy the API Secret and save them somewhere safe. The API secret will never be shown again.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/pureml/self-hosting/images/Settings_APITokenCreate_Updated.png" alt="CreateAPIToken" />

Go to your organization settings page to get your organization id. This will be useful in the next step.

<Tabs>
  <Tab title="SDK">
    While using the SDK after importing use the login function to login using API Token as below:

    ```python theme={null}
    import pureml

    pureml.login(org_id="ENTER_YOUR_ORG_ID", api_key="ENTER_API_KEY")
    ```
  </Tab>

  <Tab title="CLI">
    You can use CLI to signin using API token by:

    <CodeGroup>
      ```bash >_ Terminal theme={null}
      pureml auth login --api-key
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## Usage

You can use your local self-hosted backend in the sdk by using the `set_backend` function
Example:

<Note>
  Assuming your backend url is [*localhost:8080/api*](http://localhost:8080/api)
</Note>

```python theme={null}
import pureml

# Call this function near the initialization of your scripts, preferably just after importing
pureml.set_backend("http://localhost:8080/api/") # trainling slash at the end is important

...
```

## Additional configuration

#### Frontend environment

| Variable     | Description                         | Default Value                                            |
| ------------ | ----------------------------------- | -------------------------------------------------------- |
| BACKEND\_URL | backend url env to connect frontend | [http://localhost:8080/api/](http://localhost:8080/api/) |

#### Backend environment

There are multiple environment variables that can be configured externally. But the application also depends upon the configuration of the docker image used to build the compose.

<Warning>
  For backend, **Currently only base image is officially supported**. There will
  be S3, R2, etc. configured images soon which can be used in the compose to
  setup object storage or other settings configuration
</Warning>

For Base Configuration :
*Rows with a missing 'Default Value' usually default to an empty string. This is different from `None`.*

| Variable              | Description                                                                 | Default Value |
| --------------------- | --------------------------------------------------------------------------- | ------------- |
| PORT                  | port where backend will be deployed                                         | 8080          |
| DATABASE              | type of database which will be used. Currently supported sqlite3 & postgres | sqlite3       |
| DATABASE\_URL         | url for the database (❗**Required** if database type is postgres)           |               |
| CGO\_ENABLED          | whether to use cgo (requires gcc) or pure go                                | 1             |
| PURE\_SITE\_BASE\_URL | frontend url for email redirections                                         |               |
