Skip to main content
The SDK automatically creates secure Git URLs with embedded JWT authentication.
// Default: read/write access, 1-year TTL
const url = await repo.getRemoteURL();

// Read-only access with 1-hour TTL
const readOnlyUrl = await repo.getRemoteURL({
  permissions: ["git:read"],
  ttl: 3600,
});

// CI/CD pipeline with extended permissions
const ciUrl = await repo.getRemoteURL({
  permissions: ["git:read", "git:write"],
  ttl: 86400, // 24 hours
});

Options

ParameterTypeDescription
permissionsOptionalArray of permissions. Defaults to ["git:read", "git:write"].
ttlOptionalToken TTL in seconds. Defaults to 31536000 (1 year).

Available Permissions

PermissionDescription
git:readRead access to Git repository
git:writeWrite access to Git repository
repo:writeCreate a repository

Ephemeral Remote URL

Use getEphemeralRemoteURL() (TypeScript) or get_ephemeral_remote_url() (Python) to generate URLs that point to the ephemeral namespace. This is useful for temporary branches that shouldn’t sync to upstream mirrors. See the Ephemeral Branches guide for more details.

Response

Returns a string containing the HTTPS Git remote URL with embedded JWT authentication:
https://t:{jwt}@{org}.code.storage/{repo-id}.git
For ephemeral URLs, the format is:
https://t:{jwt}@{org}.code.storage/{repo-id}+ephemeral.git