> For the complete documentation index, see [llms.txt](https://docs.flxbl.io/flxbl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flxbl.io/flxbl/sfp/environment-management/pools/scratch-org-pools/setting-up-your-salesforce-org-for-scratch-org-pools.md).

# Setting up your Salesforce Org for Scratch Org Pools

Scratch org pool state — pool membership, credentials and allocation — lives on sfp server. The Dev Hub needs no metadata for pooling: no package to install, no custom fields, no sharing rules. Setting up a Dev Hub for pools is registering it with the server.

## Register the Dev Hub with sfp server

Authenticate the Dev Hub locally, then register it:

```bash
sf org login web -a devhub
```

```bash
sfp server org register -u devhub --devhub --default
```

Prepare validates the Dev Hub's authentication before it starts. The Dev Hub must hold either a valid SFDX auth URL or an access token — `auth:web`, `auth:store`, `auth:accesstoken:store` or `org login --server` all qualify. A Dev Hub registered via External Client App JWT bearer also works; scratch org signup is pinned to the PlatformCLI connected app in that case, and the resulting orgs carry standard refresh-token credentials.

{% hint style="info" %}
Store the Dev Hub's SFDX auth URL in a secrets manager rather than in the repository. The value grants full access to the Dev Hub.
{% endhint %}

## Developer access to scratch orgs

Developers fetch scratch orgs through sfp server:

```bash
sfp pool fetch -r <owner>/<repo> -p <pool-tag> --assignment-id <id> --alias my-org
```

The server holds each pooled org's credentials from the moment it is provisioned and returns them on fetch — the same applies to `sfp scratch login` and to fetching an environment in codev. A developer needs no access to the Dev Hub or to any of its objects.


---

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp/environment-management/pools/scratch-org-pools/setting-up-your-salesforce-org-for-scratch-org-pools.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
