Connect Flutter to Artifactory

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide

Configure Flutter to connect to your Artifactory repositories.

Prerequisite: Before connecting the Flutter client to Artifactory, you must have an existing pub repository in Artifactory. For more information, see Create a pub Repository.

Logged in vs. Anonymous User: You can work with pub and Artifactory as a logged-in user or anonymously. To work with Artifactory using Anonymous Access, configure that access under Admin | Security | General. For details, see Allow Anonymous Access.Allow Anonymous Access

To connect the Flutter client to Artifactory:

  1. Run this command to add the Artifactory repository to your Flutter client:

    flutter pub token add "https://[JFrogPlatformURL]/artifactory/api/pub/<REPO_NAME>"

    Where:

    • [JFrogPlatformURL]: The URL of your JPD

    • <REPO_NAME>: The name of the target repository in Artifactory

    For example:

    flutter pub token add "https://company.jfrog.io/artifactory/api/pub/pub-local"
  2. When prompted, enter your Artifactory identity token.

  3. Set the environment variable:

    export PUB_HOSTED_URL="https://[JFrogPlatformURL]/artifactory/api/pub/<REPO_NAME>"

    Where:

    • [JFrogPlatformURL]: The base URL of your JPD

    • <REPO_NAME>: The name of the target repository in Artifactory

    For example:

    export PUB_HOSTED_URL="https://company.jfrog.io/artifactory/api/pub/pub-local"

Note

You can also use JFrog Set me up to copy the snippet populated with your token and environment. For more information, see Use Artifactory Set Me Up for Configuring Package Manager Clients.

Next steps: