Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,54 @@ With an instantiated `Client` object, and username and password set as environme
client.authenticate()
```

### Using different environments

The `Client` defaults to using the Uncertainty Engine production environment. To use a different named environment, pass it as the `env` argument:

```python
client = Client(env="dev")
```
Comment thread
cariad marked this conversation as resolved.

If a custom environment has been provided for you, pass an `Environment` that describes the details:

```python
from uncertainty_engine import Client, Environment

client = Client(
env=Environment(
cognito_user_pool_client_id="…",
core_api="…",
region="…",
resource_api="…",
Comment thread
cariad marked this conversation as resolved.
),
)
```

| Argument | Format | Example |
| ----------------------------- | --------------------------------------------- | -------------------------------------------------------- |
| `cognito_user_pool_client_id` | Alphanumeric string | `3vj5pe253j4v070euqjdk38a24` |
| `core_api` | Starts with `https://`, does not end with `/` | `https://de1v75vvk6.execute-api.eu-west-2.amazonaws.com` |
| `region` | Geographic region code | `eu-west-2` |
| `resource_api` | Starts with `https://`, does not end with `/` | `https://m90q55iux6.execute-api.eu-west-2.amazonaws.com` |

**Note:** Every password is tied to a specific environment. A password for the production environment, for example, won't grant access to the development environment. Ensure you set the correct `UE_PASSWORD` value for the environment you configure.
Comment thread
cariad marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also include this line somewhere in this section as a reminder:

Note
If you are switching between different environments, you need to delete your ~/.ue_auth file before trying to change between the environments.

It is something that is coming up a lot, and it will be useful to make it clear in the documentation that when people are switching between environments, they shouldn't forget this step.

### Troubleshooting

Authorisation tokens are cached in `.ue_auth` in your home directory. If the SDK fails to authenticate you (for example, after switching from one environment to another), delete `.ue_auth` to generate and cache new tokens.

To delete the cache in macOS or Linux:

```bash
rm ~/.ue_auth
```
Comment thread
cariad marked this conversation as resolved.

To delete the cache in Windows:

```bat
del "%USERPROFILE%\.ue_auth"
```

### Running a node

```python
Expand Down
Loading