expose(project: string, environment: string, options?: ProductScope): Promise<EnvironmentResource>Turns on public exposure by posting { exposed: true } for you. A branded public URL then serves the variables of that environment as ciphertext, so anyone with the link still needs the workspace passphrase or key to read a value. Nothing is decrypted server-side.
Two independent flags have to line up or the call is refused. The workspace needs virtualEnvsEnabled, which you set with workspace.update, and the product that owns the project must not be private. A private product fails with environment.expose_private_product and can never be exposed, so move the project or unset privacy first.
Example
await envless.workspace.update({ virtualEnvsEnabled: true })
const environment = await envless.environments.expose('api', 'production')
console.log(environment.exposed)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | string | Yes | Project slug or uniqueId that owns the environment. |
environment | string | Yes | Slug of the environment to expose; ids are not accepted. |
options.product | string | No | Product slug that disambiguates an ambiguous project slug. |
options.signal | AbortSignal | No | Cancels the request. |
Returns
EnvironmentResource with exposed true, plus updatedAt.
Worth knowing
- The two-flag opt-in is deliberate, so a single accidental toggle cannot publish a feed.
- Anything you would not hand out as ciphertext does not belong in an exposed environment.
Required scopes
environments:write
Underlying endpoint
POST /projects/{slug}/environments/{environmentSlug}/expose
Request and response schema, every error code, and a live playground.
In Python
envless.environments.expose()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.environments.expose
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->environments->expose()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.