Quickstart · 5 minutes
Integrate Libermall ID in 5 minutes
From zero to a working "Sign in with Libermall ID" button on your site.
Steps
1. Get a client_id 2. Install the SDK 3. Configure the redirect 4. Add the button 5. Handle the callback1. Get a client_id
Email hello@libermall.com with:
- Service name and URL
- Redirect URIs (one or more)
- Required scopes:
openid profile emailat minimum
You will receive client_id and client_secret within 24 hours.
2. Install the SDK
npm install openid-client
# or for Laravel
composer require laravel/socialite
# or for Python
pip install authlib
3. Configure the redirect
Configure an OAuth client in your application with these values:
LIBERMALL_ID_HOST=https://id.libermall.com
LIBERMALL_ID_CLIENT_ID=
LIBERMALL_ID_CLIENT_SECRET=
LIBERMALL_ID_REDIRECT=https://yourapp.com/oauth/libermall/callback
4. Add the button
Ready-made snippet — copy as is:
<a href="/oauth/libermall" class="libermall-btn">
<svg width="20" height="20" viewBox="0 0 100 100">
<path d="M 16 14 L 38 14 L 50 38 L 62 14 L 84 14 L 84 60 L 50 94 L 16 60 Z" fill="#FFD60A"/>
</svg>
Sign in with Libermall ID
</a>
<style>
.libermall-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 22px;
background: #FFD60A;
color: #0A0A0C;
border-radius: 10px;
font-weight: 600;
text-decoration: none;
}
.libermall-btn:hover { background: #FFCB1A; }
</style>
5. Handle the callback
Express example:
app.get('/oauth/libermall', (req, res) => {
const url = `${process.env.LIBERMALL_ID_HOST}/login/oauth/authorize?` +
`response_type=code&client_id=${process.env.LIBERMALL_ID_CLIENT_ID}` +
`&redirect_uri=${encodeURIComponent(process.env.LIBERMALL_ID_REDIRECT)}` +
`&state=${crypto.randomUUID()}&scope=openid+profile+email`;
res.redirect(url);
});
app.get('/oauth/libermall/callback', async (req, res) => {
const { code } = req.query;
const tokenRes = await fetch(`${process.env.LIBERMALL_ID_HOST}/api/login/oauth/access_token`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
grant_type: 'authorization_code',
code,
client_id: process.env.LIBERMALL_ID_CLIENT_ID,
client_secret: process.env.LIBERMALL_ID_CLIENT_SECRET,
redirect_uri: process.env.LIBERMALL_ID_REDIRECT,
}),
});
const { access_token } = await tokenRes.json();
const userRes = await fetch(`${process.env.LIBERMALL_ID_HOST}/api/userinfo`, {
headers: { Authorization: `Bearer ${access_token}` },
});
const user = await userRes.json();
req.session.user = user;
res.redirect('/');
});
Done 🎉
Users can sign in via Telegram, TON Connect, Google, Apple or Email with one button. Details in the full documentation.
Need help?
Describe your stack at hello@libermall.com — we will help with the integration.