> For the complete documentation index, see [llms.txt](https://docs.startrail.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.startrail.io/startrail-sdk-js/change-logs/v2.2.0.md).

# v2.2.0

## [npmjs](https://www.npmjs.com/package/@startbahn/startrail-sdk-js/v/2.2.0)

{% hint style="success" %}
**Highlight —** a single `email_passwordless` provider with a known email (`loginHint`) now logs the user in **without opening the selection modal**.
{% endhint %}

## ✨ Changes

* **Email Passwordless without a modal.** When a single `email_passwordless` login provider is configured together with a `loginHint` (the user's email, known in advance), `login()` now starts the passwordless flow directly and **skips the login-provider selection modal**.
  * New `loginHint` option, accepted both on the constructor config and on the per-call `login()` override.
  * If `loginHint` is missing or not a valid email, the modal opens as before — so the behaviour is safe to adopt incrementally.
* **Quieter by default — new `debug` flag.** The SDK no longer prints verbose logs to the browser console. Pass `debug: true` in the constructor config to re-enable detailed logging while developing.
* **`mfaLevel` is deprecated.** It has no effect since Torus-embed v6 (the underlying ws-embed API has no MFA-level support). Existing code that passes `mfaLevel` keeps working, but the option is ignored.

{% code title="Skip the modal with loginHint" overflow="wrap" %}

```typescript
const sdk = new Startrail({
  env: 'staging',
  loginProvider: ['email_passwordless'],
  loginHint: 'user@example.com', // known email → passwordless starts directly, no modal
})
await sdk.login()
```

{% endcode %}

{% content-ref url="<https://github.com/startbahn/api-portal/tree/main/startrail-sdk-js/initialization.md>" %}
<https://github.com/startbahn/api-portal/tree/main/startrail-sdk-js/initialization.md>
{% endcontent-ref %}

## 🤖 Agent & LLM friendly

This release ships first-class resources so AI coding tools (Claude, Cursor, Copilot, …) integrate the SDK correctly with minimal context.

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>📄 llms.txt</strong></td><td>Machine-readable API reference — install, lifecycle, every method signature, the environment table and the error catalogue.</td><td><strong>Bundled in the npm package</strong><br><code>node_modules/@startbahn/startrail-sdk-js/llms.txt</code></td></tr><tr><td><strong>🤖 AGENTS.md</strong></td><td>Rules + the canonical <code>construct → login → action</code> pattern for agents writing code against the SDK.</td><td>In the SDK source repository</td></tr><tr><td><strong>💬 Typed TSDoc</strong></td><td>Rich hover docs and autocomplete on the public class and request/response types, straight from your editor.</td><td>Bundled in the package types</td></tr></tbody></table>

{% hint style="info" %}
Point your AI assistant at `node_modules/@startbahn/startrail-sdk-js/llms.txt` for an accurate, version-matched reference instead of relying on its training data.
{% endhint %}

## 🛠️ Internal

* Migrated the build/release toolchain from Yarn to **pnpm 11 (Node 22)** and refreshed the lint/build config. No change to how you install or consume the package.
* Refactored the Torus login flow (more reliable early-EOA return) and resolved outstanding Dependabot security alerts.

{% content-ref url="/pages/frSJRNrPXDXGs0OwRaIS" %}
[URL per environment](/readme/url-per-environment.md)
{% endcontent-ref %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.startrail.io/startrail-sdk-js/change-logs/v2.2.0.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
