# Class Credentials

Get and set the credential in the JSON file if we cant find credentials.json

Final
Namespace: Catapult
Object:

Credentials can also be loaded by associative an array or from the envorinment variables

Located at core/Credentials.php

## Methods summary

`public` | # `__construct( user_token: $user_token = '', api_token: $api_token = '', api_secret: $api_secret = '' )` All string parameters if provided use these in place of json credentials All string parameters if provided use these in place of json credentials #### Parameters $user_token user id $api_token token $api_secret secret
`public` | # `get( $key = null )`
`protected stdClass` | # `getParamInstance( )` Returns the area we've initialized the credentials object with. Possibilities Returns the area we've initialized the credentials object with. Possibilities #### Returns stdClass [JSON Object] \stdClass [CredentialsUser]
`protected` | # `getVal( key: $key, show: $show = TRUE )` Gets either a singular or array based value by key. Where all keys are elements in the credentials.json file. Gets either a singular or array based value by key. Where all keys are elements in the credentials.json file. #### Parameters $key for element $show with asterisks
`public` | # `getNumber( idx: $idx )` Gets a number from the provided set in credentials.json. This will not have any affect towards the PhoneNumber service. Gets a number from the provided set in credentials.json. This will not have any affect towards the PhoneNumber service. #### Parameters $idx of number
`public` | # `getApplicationId( idx: $idx = 0 )` Shortcut. Get the first app id. Usage Shortcut. Get the first app id. Usage #### Parameters $idx of app
`public` | # `set( key: $key, val: $val )` Set a value at runtime Set a value at runtime #### Parameters $key to set $val value
`public static` | # `setPath( path: $path )` Sets the path of credentials.json Sets the path of credentials.json #### Parameters $path path
`public static` | # `setFile( file: $file )` Sets the file to find credentials suitable when the term credentials is not being used for the credentials file Sets the file to find credentials suitable when the term credentials is not being used for the credentials file #### Parameters $file file

## Properties summary

`public static array` | $credentials_opts credentials should initially be set to 'credentials.json' which will be found in the parent directory credentials should initially be set to 'credentials.json' which will be found in the parent directory | # `array( "file" => "credentials.json" )`