Atlas SDK
Which call do I use? Find your goal in the table, open its page. The same calls exist in C++, JavaScript and Python.
Find the call
| I want to | Call | Page |
|---|---|---|
| Start the library | Startup() | Session Lifecycle |
| Sign in with a license key | License::Login(key) | License |
| Sign in with a username and password | Account::Login(user, password) | Account |
| Let a signed-in user add a key to their account | Account::Redeem(key) | Account |
| Show how many days are left | Data::GetDaysRemaining() | Data |
| Read the username, IP or expiry of the session | Data::GetUsername(), GetIP(), GetExpiry() | Data |
| Find out why a call failed | Data::GetErrorMessage() | Data |
| Confirm the session is still valid before a sensitive action | Network::CheckAuthentication() | Network |
| Download a file you uploaded on the dashboard | Network::Download(file_id) | Network |
| Write a line to the dashboard Logs tab | Network::SubmitLog(text) | Network |
| Ban the current user | Network::BanUser(reason, minutes) | Network |
| Change a setting without shipping a new build | Variables::Fetch(key) | Variables |
| Turn a feature on or off per customer | Entitlements::Has(key) | Entitlements |
| Sell credits and charge one per action | Entitlements::Consume(key) | Entitlements |
| Send a message to Discord, Slack or your own server | Webhook::SendDiscord(url, message) | Webhook |
| Show a ready-made sign-in window (C++ only) | License::Dialog::Login(), Account::Dialog::Login() | Dialog |
The order
- 1
- 2
- 3
- 4
- 5
Atlas::API_KEY = "YOUR_API_KEY";Atlas::Startup(); if (!Atlas::License::Login("ATLAS-A9F2K-4RMXM")) { std::cout << Atlas::Data::GetErrorMessage(); // why it failed return 1;} RunApp();Atlas::Logout();When a call fails
A call that can fail returns false, or an empty value: "", 0 or an empty list. It does not raise. The one exception is Startup(), which raises in JavaScript and Python and ends the process in C++.
The reason is in Data::GetErrorMessage(). Read it right after the failing call, because the next call can replace it. Show it to your user, or log it. Do not parse it: the wording can change.
Names in each language
Same names everywhere. C++ writes Atlas::Data::GetExpiry(), JavaScript and Python write atlas.Data.GetExpiry(). One exception: signing in to a license with a username and password is License::Login(user, password) in C++ and License.LoginUser(user, password) in JavaScript and Python, because those languages have no overloads.