# `plandalf.ready()`

Run a callback when the SDK instance is ready.

Implemented by the [browser object](https://github.com/plandalf/numi/blob/fc6f42b5ade3d63b71623934838a6509f17203e2/packages/sdk/src/browser.ts#L451).

## Signature

```typescript
plandalf.ready(cb: (instance: Plandalf) => void): void
```

## Arguments

| Name | Type | Meaning |
| --- | --- | --- |
| `cb` | (`instance`: [`Plandalf`](https://plandalf.com/docs/packages/sdk/classes/Plandalf)) =\> `void` | Callback invoked with the initialized class instance. |

## Example

```javascript title="ready.js" lineNumbers lineNumberStart=1
plandalf.ready(() => {
  console.log(plandalf.getAnonId())
})
```

## Returns

`void`

## Behaviour

Use this callback before calling methods that depend on initialization. It receives the raw `Plandalf` class instance, but ordinary browser code can keep using `plandalf`.

[All plandalf methods](https://plandalf.com/docs/sdk)

Source: https://plandalf.com/docs/sdk/ready
