Language-specific SDKs built around the Synapse API
Currently in Beta
Instead of using the API directly, you can use our client libraries:
Python | JavaScript | Ruby | PHP | Go
Deprecated Client Libraries
For platforms using older versions of the client libraries we recommend updating to the new libraries above. The older libraries are no longer maintained and will soon be deprecated.
Note: The older client libraries do not support changing an account from
personal
tobusiness
. To use this and other newer features, we recommend upgrading to a newer library.
Library Initialization
import synapsepy
client = Client(
client_id='client_id_1239ABCdefghijk1092312309',
client_secret='client_secret_1239ABCdefghijk1092312309',
fingerprint='1023918209480asdf8341098',
ip_address='1.2.3.132',
devmode=True
)
const Synapse = require('synapsenode');
const Client = Synapse.Client;
const client = new Client({
client_id: process.env.CLIENT_ID,
client_secret: process.env.CLIENT_SECRET,
fingerprint: process.env.FINGERPRINT,
ip_address: '<ip_address>',
isProduction: false
});
args = {
# synapse client_id
client_id: ENV.fetch("client_id"),
# synapse client_secret
client_secret: ENV.fetch("client_secret"),
# a hashed value, either unique to user or static for app
fingerprint: "fp",
# end user's IP
ip_address: 'ip',
# (optional) requests go to sandbox endpoints if true
development_mode: true,
# (optional) if true logs requests to stdout
logging: true,
# (optional) file path to write logs to
log_to: nil,
# (optional) rases for 2FA and MFA if set to true
raise_for_202: true
}
client = Synapse::Client.new(args)
require_once 'vendor/synapsefi/synapsephp/synapse_rest/client.php';
$clientObj = (object) [
'client_id' => 'your_client_id',
'client_secret' => 'your_client_secret',
'fingerprint' => '|your_finger_print',
'ip_address' => 'your_ip_address',
'devmode' => True,
'logging' => True,
'handle202' => True
];
client = Client($clientObj);
import github.com/SynapseFI/SynapseGo
// credentials used to set headers for each method request
var client = synapse.New(
"CLIENT_ID",
"CLIENT_SECRET",
"FINGERPRINT",
"IP_ADDRESS",
)
Automatic OAuth Updates
You do not need to add
oauth_key
to the headers after a user is created and authentication is performed. The libraries automatically do that for you.