Skip to content

PromptScript API


Function: buildAuthenticatedUrl()

buildAuthenticatedUrl(url, token): string

Defined in: resolver/src/git-url-utils.ts:216

Build an authenticated Git URL with a token.

Parameters

url

string

Original Git URL

token

string

Authentication token (PAT)

Returns

string

URL with embedded token for HTTPS auth

Example

buildAuthenticatedUrl('https://github.com/org/repo.git', 'ghp_xxxx');
// 'https://ghp_xxxx@github.com/org/repo.git'