# The data is behind a login. Log in once, read it every day.

Portals, dashboards, supplier sites: the data you need sits behind a sign-in form. Kaabist runs the login as part of a program, keeps the session between jobs, and reads the pages as typed, validated fields.

## The problem

Scraping APIs fetch public pages. Behind a login you need a form, a session and sometimes a code, and a scraper that signs in on every single run gets rate-limited, challenged or locked out.

## Log in as part of the program

The login is ordinary steps: fill, click, expect. Credentials are inputs given at run time, never written into the program, and password values are redacted wherever a page is recorded.

```
{ "goto": "https://portal.example.test/login" },
{ "fill": "#email", "value": "{{inputs.email}}" },
{ "fill": "#password", "value": "{{inputs.password}}" },
{ "click": { "role": "button", "name": "Sign in" },
  "expect": { "url": "**/dashboard" } }
```

## Keep the session

Save the session at a checkpoint after the login. The next job that resumes from it goes straight to the data while the session is valid, and signs in again only when it has expired.

```
{ "checkpoint": { "name": "logged_in", "save_session": "supplier" } }
```

## Typed fields, not HTML

Extract declares what each field is: money, dates, integers, lists. Values are parsed and validated, and a field that stops filling is noticed before your next run depends on it.

```
{ "extract": {
  "invoice": "h1",
  "total": { "selector": ".total", "type": "money" },
  "due": { "selector": ".due-date", "type": "date" }
} }
```

## When the site adds a step

If the portal starts asking for a one-time code, the job pauses on it and Kaabist emails you a link to type the code. The program does not fail, and it does not start over.

## Questions

### Where are the credentials stored?

They are inputs of the job or the schedule, stored encrypted and never returned by the API; secret inputs are never shown back.

### What if the session expires mid-week?

The program signs in again from the start of its steps, saves the new session, and continues.
