Skip to content

Commit 0653e32

Browse files
committed
refresh stale README
1 parent fe1a475 commit 0653e32

1 file changed

Lines changed: 74 additions & 11 deletions

File tree

README.md

Lines changed: 74 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ Use of this project with Salesforce is subject to the [TERMS OF USE](./TERMS_OF_
1212
- JDK 17
1313
- Docker support like [Docker Desktop](https://docs.docker.com/desktop/)
1414
- A salesforce org with some DLOs or DMOs with data and this feature enabled (it is not GA)
15-
- An [External Client App](#creating-an-external-client-app)
15+
- **One of the following** for authentication:
16+
- A Salesforce org already authenticated via the [Salesforce CLI](https://developer.salesforce.com/tools/salesforcecli)
17+
(simplest — no External Client App needed)
18+
- An [External Client App](#creating-an-external-client-app) configured with OAuth settings
1619

1720
## Installation
1821
The SDK can be downloaded directly from PyPI with `pip`:
@@ -65,6 +68,13 @@ datacustomcode configure
6568
datacustomcode run ./payload/entrypoint.py
6669
```
6770

71+
> [!TIP]
72+
> **Already using the Salesforce CLI?** If you have authenticated an org with `sf org login web
73+
> --alias myorg`, you can skip `datacustomcode configure` entirely:
74+
> ```zsh
75+
> datacustomcode run ./payload/entrypoint.py --sf-cli-org myorg
76+
> ```
77+
6878
> [!IMPORTANT]
6979
> The example entrypoint.py requires a `Account_std__dll` DLO to be present. And in order to deploy the script (next step), the output DLO (which is `Account_std_copy__dll` in the example entrypoint.py) also needs to exist and be in the same dataspace as `Account_std__dll`.
7080
@@ -183,17 +193,19 @@ Options:
183193
- `--auth-type TEXT`: Authentication method (default: `oauth_tokens`)
184194
- `oauth_tokens` - OAuth tokens with refresh_token
185195
- `client_credentials` - Server-to-server using client_id/secret only
186-
- `--login-url TEXT`: Salesforce login URL
187196

188-
For OAuth Tokens authentication:
189-
- `--client-id TEXT`: External Client App Client ID
190-
- `--client-secret TEXT`: External Client App Client Secret
191-
- `--refresh-token TEXT`: OAuth refresh token (see [Obtaining Refresh Token](#obtaining-refresh-token-and-core-token))
192-
- `--core-token TEXT`: (Optional) OAuth core/access token - if not provided, it will be obtained using the refresh token
197+
You will be prompted for the following depending on auth type:
198+
199+
*Common to all auth types:*
200+
- **Login URL**: Salesforce login URL
201+
- **Client ID**: External Client App Client ID
202+
203+
*For OAuth Tokens authentication:*
204+
- **Client Secret**: External Client App Client Secret
205+
- **Redirect URI**: OAuth redirect URI
193206

194-
For Client Credentials authentication (server-to-server):
195-
- `--client-id TEXT`: External Client App Client ID
196-
- `--client-secret TEXT`: External Client App Client Secret
207+
*For Client Credentials authentication:*
208+
- **Client Secret**: External Client App Client Secret
197209

198210
##### Using Environment Variables (Alternative)
199211

@@ -255,6 +267,9 @@ Options:
255267
- `--config-file TEXT`: Path to configuration file
256268
- `--dependencies TEXT`: Additional dependencies (can be specified multiple times)
257269
- `--profile TEXT`: Credential profile name (default: "default")
270+
- `--sf-cli-org TEXT`: Salesforce CLI org alias or username (e.g. `dev1`). Fetches
271+
credentials via `sf org display` — no `datacustomcode configure` step needed.
272+
Takes precedence over `--profile` if both are supplied.
258273

259274

260275
#### `datacustomcode zip`
@@ -277,7 +292,7 @@ Options:
277292
- `--version TEXT`: Version of the transformation job (default: "0.0.1")
278293
- `--description TEXT`: Description of the transformation job (default: "")
279294
- `--network TEXT`: docker network (default: "default")
280-
- `--cpu-size TEXT`: CPU size for the deployment (default: "CPU_XL"). Available options: CPU_L(Large), CPU_XL(Extra Large), CPU_2XL(2X Large), CPU_4XL(4X Large)
295+
- `--cpu-size TEXT`: CPU size for the deployment (default: `CPU_2XL`). Available options: CPU_L(Large), CPU_XL(Extra Large), CPU_2XL(2X Large), CPU_4XL(4X Large)
281296

282297

283298
## Docker usage
@@ -365,6 +380,54 @@ You can read more about Jupyter Notebooks here: https://jupyter.org/
365380

366381
You now have all fields necessary for the `datacustomcode configure` command.
367382

383+
### Using the Salesforce CLI for authentication
384+
385+
The [Salesforce CLI](https://developer.salesforce.com/tools/salesforcecli) (`sf`) lets you authenticate an org once and then reference it by alias across tools — including this SDK via `--sf-cli-org`.
386+
387+
#### Installing the Salesforce CLI
388+
389+
Follow the [official install guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm), or use a package manager:
390+
391+
```zsh
392+
# macOS (Homebrew)
393+
brew install sf
394+
395+
# npm (all platforms)
396+
npm install --global @salesforce/cli
397+
```
398+
399+
Verify the install:
400+
```zsh
401+
sf --version
402+
```
403+
404+
#### Authenticating an org
405+
406+
**Browser-based (recommended for developer orgs and sandboxes):**
407+
```zsh
408+
# Production / Developer Edition
409+
sf org login web --alias myorg
410+
411+
# Sandbox
412+
sf org login web --alias mysandbox --instance-url https://test.salesforce.com
413+
414+
# Custom domain
415+
sf org login web --alias myorg --instance-url https://mycompany.my.salesforce.com
416+
```
417+
418+
Each command opens a browser tab. After you log in and approve access, the CLI stores the session locally.
419+
420+
**Verify the stored org and confirm the alias:**
421+
```zsh
422+
sf org list
423+
sf org display --target-org myorg
424+
```
425+
426+
Once authenticated, pass the alias directly to `datacustomcode run`:
427+
```zsh
428+
datacustomcode run ./payload/entrypoint.py --sf-cli-org myorg
429+
```
430+
368431
### Obtaining Refresh Token and Core Token
369432

370433
If you're using OAuth Tokens authentication, the initial configure will retrieve and store tokens. Run `datacustomcode auth` to refresh these when they expire.

0 commit comments

Comments
 (0)