Skip to main content

SDK Setup

What you need before starting​

Your AWS account is SSO-enabled to access https://deltatre.awsapps.com/start. After being SSO-enabled (please refer to your Project Manager), restart your development machine.

Setup​

npm connection
  • Select the Diva repository, filter by Format:npm, and select View connection instructions

    Connection instructions

  • Select Operating system, npm as the package manager, Recommended method: configure using AWS CLI, and copy the login command in Step 3

    Diva Package repository connection

  • Before executing the login command, append --namespace @deltatre-vxp at the end, like

    aws codeartifact login --tool npm --repository Diva --domain deltatre-diva --domain-owner <YOUR USER CODE> --region eu-central-1 --namespace @deltatre-vxp

    Note: The login session expires within 12 hours. Repeat the steps until the login command every time you need to update the DIVA package.

  • Select your project folder and run command npm i @deltatre-vxp/diva-sdk

  • You're ready to get started coding the front-end with the DIVA Player SDK.

Notes​

In your front-end js/typescript app, make sure to remove the tag <React.StrictMode> from the root.render function in the index.tsx file. Otherwise, the video player's sound may be out of control.

Additional documentation

maven connection
  • Download and Install AWS CLI: Follow the instructions on the AWS CLI installation page for your operating system. The AWS CLI v2 is recommended.
    Once installed, you can verify the installation by running:
aws --version
- Run AWS Configure: Open your terminal and run the following command:

aws configure

  • Enter your AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, Default region name, and Default output format as prompted.

  • Select the Diva repository, filter by Format:maven, and select View connection instructions

    Connection instructions

  • Select Operating system, configuration method and copy the login command in Step 3

    Diva Package repository connection

    Note: The login session expires within 12 hours.

    aws codeartifact login --tool gradle --repository Diva --domain deltatre-diva --domain-owner 058264107880 --region eu-central-1

    This command will configure your local environment with the necessary settings for Gradle to interact with your CodeArtifact repository, including setting the CODEARTIFACT_AUTH_TOKEN environment variable temporarily.

  • Add this Maven section to the repositories section in the project's build.gradle file

maven {
url 'https://deltatre-diva-058264107880.d.codeartifact.eu-central-1.amazonaws.com/maven/Diva/'
credentials {
username "aws"
password System.env.CODEARTIFACT_AUTH_TOKEN
}
}

**Automating Token Generation**

For continuous integration or regular development, automate the token generation as follows:

Create a script named ```generate_codeartifact_token.sh```:

#!/bin/bash export CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain deltatre-diva --domain-owner 058264107880 --region eu-central-1 --query authorizationToken --output text)

Make the script executable and run it before your build process to ensure the CODEARTIFACT_AUTH_TOKEN environment variable is always set with a valid token.

Additional documentation

swift connection
  • Download and Install AWS CLI: Follow the instructions on the AWS CLI installation page for your operating system. The AWS CLI v2 is recommended.
    Once installed, you can verify the installation by running:
aws --version
- Run AWS Configure: Open your terminal and run the following command:

aws configure

  • Enter your AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, Default region name, and Default output format as prompted.

  • Configure your swift client using this AWS CLI CodeArtifact command. The login command fetches an authorization token from CodeArtifact using your AWS credentials and lasts 12 hours. It configures swift for use with CodeArtifact by editing ~/.swiftpm/configuration/registries.json and updating credentials. inside of the json you should see diva registry. This tells SPM to search for the dependencies using AWS package registry services. In order to do this you will need an existing package downloaded in your local machine. Open terminal in the folder where the Package.swift is located and paste the credentials you got from Option 1: Set AWS environment variables: It should look something like this

export AWS_ACCESS_KEY_ID="123"
export AWS_SECRET_ACCESS_KEY="abc"
export AWS_SESSION_TOKEN="==sd45f65sd4f56sd4f6sd465fa"

- Select the ```Diva``` repository, filter by ```Format:swift```, and select ```View connection instructions```

![Connection instructions](../../../../static/img/aws/connection-instructions-swift.png "Connection instructions")

- Select ```Operating system```, ```configuration method``` and copy the login command in Step 3

![Diva Package repository connection](../../../../static/img/aws/connect-repository-swift.png "Diva Package repository connection")

**Note**: The login session expires within 12 hours.

aws codeartifact login --tool swift --repository Diva --domain deltatre-diva --domain-owner 058264107880 --region eu-central-1

This command will configure your local environment with the necessary settings for Swift to interact with your CodeArtifact repository, including setting the ```CODEARTIFACT_AUTH_TOKEN``` environment variable temporarily.


**Additional documentation**
- [Configure Swift with CodeArtifact](https://docs.aws.amazon.com/codeartifact/5.7/ug/configure-swift.html)