You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74-11Lines changed: 74 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,10 @@ Use of this project with Salesforce is subject to the [TERMS OF USE](./TERMS_OF_
12
12
- JDK 17
13
13
- Docker support like [Docker Desktop](https://docs.docker.com/desktop/)
14
14
- 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
16
19
17
20
## Installation
18
21
The SDK can be downloaded directly from PyPI with `pip`:
@@ -65,6 +68,13 @@ datacustomcode configure
65
68
datacustomcode run ./payload/entrypoint.py
66
69
```
67
70
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
+
68
78
> [!IMPORTANT]
69
79
> 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`.
-`--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)
281
296
282
297
283
298
## Docker usage
@@ -365,6 +380,54 @@ You can read more about Jupyter Notebooks here: https://jupyter.org/
365
380
366
381
You now have all fields necessary for the `datacustomcode configure` command.
367
382
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
+
368
431
### Obtaining Refresh Token and Core Token
369
432
370
433
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