The integration answer
Use Gammal Tech's Web SDK to open hosted login, inspect the current sign-in state, verify a session and sign out. Load the official script once, configure your project's HTTPS domains and use the documented methods. Your project ID is public; a user's session token is sensitive.
A useful passwordless authentication API integration needs a clear contract: which calls exist, what they return, which prerequisites they require and how the app behaves when an operation does not finish. This guide turns those questions into a deployment sequence and an acceptance checklist.
It addresses developers connecting the browser SDK. For deciding whether the account model suits your visitors, read passwordless website login. For business permissions and existing customer records, use the website authentication system design guide.
Define the authentication API's job
Gammal Tech hosts account sign-in in a popup. A successful login supplies a session token, and the SDK stores that token for its supported session flow. Your application can check the session, sign out and save or retrieve data for the signed-in account in its own project.
Here, passwordless means the website does not collect or maintain a separate application password. It does not mean that authentication has no credentials or that every security responsibility disappears. The temporary session credential must still be protected.
Login and session verification do not disclose the person's underlying Gammal Tech account name, email address, phone number, National ID number or verification documents. There is no separate developer lookup that bypasses this privacy boundary. Your project can retrieve only the customer data it previously saved for that account.
A verified session is also distinct from a business permission. It does not, by itself, decide who can manage a team, view an invoice or receive a paid feature. Define those decisions before enabling the corresponding controls.
Prepare the owner account, project and allowed domains
- Use the correct verified owner account. Each person has one Gammal Tech account, reusable across participating websites. New applicants of all nationalities submit a National ID from a country whose citizenship they hold, rather than a resident card from their country of residence.
- Open Developer Mode and create or select the project. Keep the actual project ID from the Console. It is public configuration, not a secret API key.
- Register the website addresses used by visitors. A project supports up to four HTTPS domains. The bare domain, its
wwwversion and other subdomains are separate entries. - Check the final published address. A deployment redirect can leave visitors on a different hostname from the one you expected. Test the address they actually reach.
- Complete any additional feature setup separately. A payment callback and payment enablement belong to a payment integration; they should not be invented as extra arguments to the login method.
The identity-document exceptions are limited: an Egyptian citizen living abroad may use an Egyptian passport only when their Egyptian National ID is unavailable; an Egyptian citizen living in Egypt who is under 15 and has neither a National ID nor a passport may use an Egyptian birth certificate. The documents remain private from partner developers.
Browser requests for account features must come from the registered project domains. The current documented login call takes no project-ID argument, and the guide does not prescribe an init() step for this flow. Keep the project ID available for features that explicitly require it, but do not add a guessed initialization method, secret key or authorization header.
Guest payment links are a separate public, shareable flow: they can be opened without a domain whitelist or a secret API key, and sharing the same link does not change its receiving owner. They do not establish an SDK login session or automatically link a guest payment to user storage.
Load the SDK before the code that uses it
Include the official script once, before your application script. In a page with a Content Security Policy, allow the resources required by your actual integration through the site's reviewed policy. Do not solve a blocked dependency by disabling the policy.
<script src="https://api.gammal.tech/sdk-web.js"></script>The SDK exposes a global GammalTech object. This small readiness check establishes whether the methods used below are available; it does not establish that a user is authenticated or that the domain configuration is correct.
const sdk = window.GammalTech;
const methods = [
'login', 'logout', 'isLoggedIn',
'getToken', 'verify', 'onAuth'
];
const sdkReady = Boolean(sdk) && methods.every(
name => typeof sdk[name] === 'function'
);Use that result to keep unavailable controls disabled and show a brief neutral status. Never print a live token to prove that the SDK loaded. If the dependency is unavailable, inspect script delivery and ordering before debugging account behavior.
Use the documented methods and return values
| Method | Documented result | Integration responsibility |
|---|---|---|
login() | A Promise resolving to the session token after sign-in. | Start from the user's sign-in action, await completion and keep the returned credential private. |
logout() | A Promise; signs out and clears the local session. | Handle completion and failure. The guide does not specify a resolved payload to inspect. |
isLoggedIn() | A boolean. | Use for the SDK's current sign-in state, rather than confusing it with a returned user profile. |
getToken() | A string or null. | Most SDK calls manage it internally. Do not treat it as a permanent customer ID. |
verify() | A Promise that confirms session validity. | Use the documented session-verification operation. The guide does not define its resolved JavaScript value. |
onAuth(onIn, onOut) | A Promise; runs the matching callback. | Render the appropriate state when called. Continuous event subscription is not documented. |
Each method is called on GammalTech, for example GammalTech.verify(). The current guide uses verify(), not verifySession(). It also provides GammalTech.injectAuth(selector, options) for a ready-made sign-in and sign-out control; review its current options before depending on customized behavior.
The reference describes the raw /sdk/verify/ HTTP response as { success: true, valid: true }. That is an endpoint response description, not a guarantee that the JavaScript wrapper resolves to exactly that object. Likewise, do not invent named cancellation errors or a user.email return value when the public contract does not specify them.
If your integration must branch on an exact return object or error code not defined in the current reference, confirm the supported contract before releasing that branch. A method-presence check or an assumed truthy Promise is not a substitute for understanding its result.
Connect one deliberate user action to one operation
Use this sequence to connect your application's controls. These are steps for your UI, not additional API calls.
- Render the initial state. Use the documented auth helper on page load. Keep account-dependent content hidden while the initial decision is pending.
- Start login from a clear button. Open the popup in response to a deliberate user action. Avoid a delayed automatic popup that browsers may block.
- Await the login operation. Disable duplicate attempts while it is pending. Do not treat the popup opening as successful sign-in.
- Load account-specific work. Once the session is established, retrieve the project's saved data before enabling changes.
- Reflect completed operations accurately. Show “Saved” only after a save succeeds, and update the signed-out view after sign-out.
A native button provides keyboard interaction and an explicit accessible label. Keep the sign-out action easy to find, communicate pending states in text and return users to a meaningful place after the popup closes. Avoid making a status understandable only by color.
For the details of session checks, restoring data and avoiding a late response after sign-out, see passwordless web authentication sessions and saved data.
Handle failures without inventing an error contract
| Situation | Required outcome |
|---|---|
| SDK unavailable | Show a brief unavailable status, keep controls disabled and investigate loading or policy configuration. |
| Popup blocked or closed | Keep the visitor signed out unless authentication completes; allow a deliberate second attempt. |
| Session cannot be confirmed | Do not expose account-dependent content based on a stale screen. Offer recovery without claiming every failure means account rejection. |
| Data retrieval fails | Do not interpret the failure as an empty account or overwrite saved work with defaults. |
| Save or sign-out request fails | Do not announce remote success. Restore a usable control and keep private information out of error output. |
| Additional OTP usage lacks project funds | Follow the funding recovery path; a wallet balance alone is not the project's spending balance. |
The SDK handles brief network retries internally. Avoid wrapping it in an unlimited retry loop or opening repeated login popups automatically. Let users make another attempt after the application has settled into a clear state.
Use short customer-facing status messages rather than raw exceptions. Private diagnostic reports should identify the operation and safe technical context while excluding tokens, identity documents and full customer records. Do not send session credentials to Google Analytics or expose them in screenshots and support messages.
Connect the storage contract without requesting a profile
GammalTech.user.get() returns a Promise resolving to the stored data object, or an empty object when nothing has been saved. GammalTech.user.save({ ... }) returns a Promise and merges the supplied top-level fields. Both require the user to be logged in.
The limit is 1 MB per user, and keys beginning with _gt_ are reserved. Replacing a nested object replaces that entire value, so read the worked data-merge example before designing a settings editor.
Language preferences, bookmarks, compact progress, small drafts and settings are suitable uses. The service is not an unlimited file archive or a complete shared company database. Saved data persists across visits and devices, while the login token changes. Do not use the token as a permanent identifier to join old customer records.
Your app can collect information directly from a customer when necessary for its own feature. Such an email field or display-name form is separate from the private Gammal Tech account and is not verified by the login result. Free-text support messages and documents may therefore contain personal information even though login itself does not disclose it.
Use an acceptance matrix before replacing the current login
| Check | Pass condition |
|---|---|
| Published hostname | The final HTTPS address matches an allowed domain; both bare and www are covered if both serve the app. |
| SDK readiness | The SDK loads once before application code and expected methods exist. |
| Successful sign-in | The awaited login completes, the correct UI appears and no credential is displayed or recorded in analytics. |
| Incomplete sign-in | Closing the popup does not expose the signed-in view or start a save. |
| Returning account | Previously saved fictional data returns after sign-out and a new login. |
| Fresh tab and second device | The app follows supported sign-in and restoration behavior without promising automatic session sharing. |
| Failed operation | Neutral status, no raw exception or token exposure, no false success and no endless retry. |
| Sign-out | The account view clears; a late response does not restore it. No unsupported “all devices” promise appears. |
Record results using non-sensitive sample data and accounts you are authorized to test. Existing customer migration is a separate release requirement: decide how old records will be linked through a verified process, because automatic migration is not documented.
Budget for codes separately from authentication calls
Login, logout and session verification are free with unlimited use. User storage is also free within the 1 MB per-user limit. Each project includes 200 OTP codes per month across login and checkout identity verification. Additional codes cost 0.40 EGP each, approximately US$0.0077 at the historical conversion below.
For 300 qualifying codes in a month, 200 are included and the remaining 100 cost 40 EGP, approximately US$0.77 at that reference rate. This example covers code usage, not every paid platform feature. A login count and a delivered-code count should not be assumed to be identical.
The allowance resets monthly per project. Add funds to the personal wallet, then transfer them into the project balance for paid use. The first project is free; additional projects have a one-time fee shown in the Console. Follow the authentication code pricing comparison for the delivery-cost question, or the Firebase authentication pricing comparison when evaluating alternatives.
Currency guide: EGP amounts are the billing prices. USD estimates retain the original article's rate of USD 1 = EGP 51.78, calculated from the midpoint of Banque Misr's buying and selling rates on 24 September 2026. These are historical illustrations, not a live exchange-rate quote; payment-provider rates and fees may differ.
Developer questions
Do I need a different Gammal Tech account for every website?
No. A person reuses one verified account across participating websites. Your project receives its own saved app data for that person, not a directory of their activity or records across unrelated projects.
Where do I put the secret API key?
This integration has no secret developer API key. Configure registered HTTPS domains and use the actual public project ID where the documented feature requires it. A live session token remains sensitive.
Can I build a customer profile from the login response?
The API does not disclose the underlying account's contact or identity information. Design your feature around the app data you save, and request any separately needed information directly and transparently.
Does a valid session prove a payment or administrator role?
No. Authenticate the visitor, then apply the trusted permission or payment decision required by the operation. Customer-editable JSON preferences are not that authority.
Does the SDK guarantee sign-out on every device?
No such guarantee is documented. The supported description is local sign-out with per-tab sessions. Confirm additional session-management requirements before making them part of your product promise.
References
Method names and platform terms checked 14 October 2026. The deployment sequence and acceptance matrix are implementation guidance, and do not add undocumented SDK features.
- Gammal Tech integration reference: account setup, auth methods, raw endpoint distinctions, storage, project domains and pricing.
- Official Web SDK script: the dependency to load for the documented browser integration.
- OWASP Session Management Cheat Sheet: session credentials and session handling.