Argo CD API Client
    Preparing search index...

    Class ArgoCdClient

    Main entry point for the Argo CD REST API client.

    const argocd = new ArgoCdClient({
    baseUrl: 'https://argocd.example.com',
    token: process.env.ARGOCD_TOKEN,
    });

    const apps = await argocd.applications.list({ project: ['default'] });
    Index

    Constructors

    Properties

    accounts: AccountResource

    Account API resource.

    applications: ApplicationResource

    Application API resource.

    applicationSets: ApplicationSetResource

    ApplicationSet API resource.

    certificates: CertificateResource

    Repository TLS/SSH certificate API resource.

    clusters: ClusterResource

    Cluster API resource.

    GPG public key API resource.

    projects: ProjectResource

    Project API resource.

    Repository credential templates API resource.

    repositories: RepositoryResource

    Repository API resource.

    Server settings API resource.

    Server version API resource.

    Methods

    • Invalidates the current session token on the Argo CD server (logout). Does not clear the token stored in this client instance.

      Parameters

      • Optionalsignal: AbortSignal

        Optional AbortSignal to cancel the request.

      Returns Promise<Record<string, never>>

      Empty object on success.

      await argocd.deleteSession();
      
    • Fetches a new session token using the stored credentials and updates the client. Throws if the client was not created with fromCredentials.

      Parameters

      • Optionalsignal: AbortSignal

      Returns Promise<void>

    • Returns info about the currently authenticated user.

      GET /api/v1/session/userinfo

      Parameters

      • Optionalsignal: AbortSignal

        Optional AbortSignal to cancel the request.

      Returns Promise<ArgoCdUserInfo>

      { loggedIn, username, iss, groups }.

      const info = await argocd.userInfo();
      console.log(info.username, info.groups);