def expose(project, environment, product: nil, timeout: nil)def expose: (
String project,
String environment,
?product: (String | Symbol)?,
?timeout: seconds?
) -> environment_resourceTurns 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
require "envless/sdk"
Envless.workspace.update(virtualEnvsEnabled: true)
environment = Envless.environments.expose("api", "production")
puts 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. |
product: | String | Symbol | No | Product slug that disambiguates an ambiguous project slug. |
timeout: | Integer | Float | Rational | No | Seconds each attempt of this call may take, redirects and the response body included, before it raises Envless::NetworkError with timeout? set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
environment_resource 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 TypeScript
envless.environments.expose()
The same method in @goenvless/sdk, with the same request, retries and errors.