Skip to main content

Options

string
Repository ID. If not provided, a UUID will be auto-generated. Supports namespacing with / (e.g., team/project-alpha).
string
Default branch name for the repository. Defaults to main.
object
Configuration for Git Sync or forking from an existing repository. See below for structure.
string
Token TTL for this invocation in seconds. Defaults to 1 hour when omitted for this call.

BaseRepo for Git Sync

Use this structure to sync with a GitHub repository:
string
required
GitHub repository owner (username or organization).
string
required
GitHub repository name.
string
GitHub repository’s default branch.

BaseRepo for Forking

Use this structure to fork from an existing Code Storage repository:
string
required
The source repository ID to fork from.
string
Branch or tag name to fork from. Forks the tip of this ref.
string
Exact commit SHA to fork at. Overrides ref if both are provided.

Response

string
The repository identifier
string
The repository’s default branch name (e.g., main)

BaseRepo for Git Sync

Use this structure to sync with a GitHub repository:
When baseRepo contains owner and name, Code Storage links the repository to an external Git provider for syncing. See the Integrations guide for details.
Generic Git providers such as GitLab, Bitbucket, Gitea, Forgejo, Codeberg, and SourceHut use the same repository creation flow at the HTTP API layer. After creating the repo, configure credentials with Git credentials.

BaseRepo for Forking

Use this structure to fork from an existing Code Storage repository:
When baseRepo contains id, a fork is created from the specified repository. See the Forking guide for details.

Response

Returns a Repository instance with the following properties: The returned repository instance also provides methods for managing branches, commits, files, and more. See the other SDK reference pages for details.