Variable frodoConst

frodo: Frodo = ...

Default frodo instance

Remarks

If your application requires a single connection to a ForgeRock Identity Platform instance at a time, then this default instance is all you need:

In order to use the default frodo instance, you must populate its state with the minimum required information to login to your ForgeRock Identity Platform instance:

// configure the state before invoking any library functions that require credentials
state.setHost('https://instance0/am');
state.setUsername('admin');
state.setPassword('p@ssw0rd!');

// now the library can login
frodo.login.getTokens();

// and perform operations
frodo.authn.journey.exportJourney('Login');

If your application needs to connect to multiple ForgeRock Identity Platform instances simultaneously, then you will want to create additional frodo instances using any of the available factory methods accessible from the default instance:

frodo.createInstance

// use factory method to create a new Frodo instance
const instance1 = frodo.createInstance({
host: 'https://instance1/am',
username: 'admin',
password: 'p@ssw0rd!',
});

// now the instance can login
instance1.login.getTokens();

// and perform operations
instance1.authn.journey.exportJourney('Login');

frodo.createInstanceWithAdminAccount

// use factory method to create a new Frodo instance ready to login with an admin user account
const instance2 = frodo.createInstanceWithAdminAccount(
'https://instance2/am',
'admin',
'p@ssw0rd!'
);

// now the instance can login
instance2.login.getTokens();

// and perform operations
instance2.authn.journey.exportJourney('Login');

frodo.createInstanceWithServiceAccount

// use factory method to create a new Frodo instance ready to login with a service account
const instance3 = frodo.createInstanceWithServiceAccount(
'https://instance3/am',
'serviceAccount',
'{"k":"jwk"}'
);

// now the instance can login
instance3.login.getTokens();

// and perform operations
instance3.authn.journey.exportJourney('Login');