Issue a template project Git credential
Exchanges the caller's Samva authorization for a one-hour Git credential scoped to the template repository.
POST
Exchanges the caller's Samva authorization for a one-hour Git credential scoped to the template repository.
apiKeyheader
x-api-key<token>id*stringMatch
^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
scope*stringValue in
"read""write"Success
application/json- response
remote*stringMatch
^https:\/\/|^http:\/\/127\.0\.0\.1:(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])\/git\/[a-z0-9-]+\/[a-z0-9-]+\.git$username*"x-access-token"Value in
"x-access-token"password*stringLength
1 <= lengthexpiresAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.templates.issueGitCredential({
"id": "example",
"scope": "read"
});Example Response
{
"remote": "string",
"username": "x-access-token",
"password": "string",
"expiresAt": "string"
}