Skip to content

How to connect?

Using the Aleo Typescript/Javascript SDK, you can connect to Obscura the following way:

const ALEO_NETWORK_URL = `https://aleo-testnet3.obscura.network/v1/${API_KEY}`;

const account = new Account({ privateKey: ALEO_PRIVATE_KEY });

const keyProvider = new AleoKeyProvider();
keyProvider.useCache(true);

const networkClient = new AleoNetworkClient(ALEO_NETWORK_URL);
const recordProvider = new NetworkRecordProvider(account, networkClient);

const programManager = new ProgramManager(ALEO_NETWORK_URL, keyProvider, recordProvider);

programManager.setAccount(account);

After this, everything should be connected, and you can continue using the Aleo SDK normally.