> This page is for Browser API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# wf.ready()

> The wf.ready() method is used to ensure the Browser API is available before calling any API methods.

This method ensures the Browser API is loaded on the page. It accepts a callback function that executes once the Browser API loads. Place any code you want to run after the Browser API is ready inside this callback function.

> **Tip**
>
> To make sure your code runs, always wrap your Browser API logic in `wf.ready()`. This ensures that the Browser API is loaded before your code runs.

### Syntax

```typescript
wf.ready(callback: () => void): void
```

### Parameters

* **callback**: `() => void` - A function that executes once the Browser API is ready to use. **Place any code using the Browser API methods inside of this callback function.**

### Example

```javascript
wf.ready( () => {
    // Your code here
    console.log("The Browser API is ready to use!");
    const consentStatus = wf.getUserTrackingChoice();
    console.log(consentStatus);
});
```