Pick only the Nookara blocks you need
The Nookara extension has grown to over 500 blocks. You can now add a small Nookara Login extension and only the add-ons your project uses.
The extensions
| Extension | Blocks | What it does |
|---|---|---|
Nookara Loginhttps://ikelene.net/gallery/extensions/nookara-login.js | 30 | Sign in, the account, your profile. Every other Nookara extension here except Forums needs this one. |
Nookara Paymentshttps://ikelene.net/gallery/extensions/nookara-payments.js | 18 | Credits, subscriptions, products, the cart and checkout. |
Nookara Datahttps://ikelene.net/gallery/extensions/nookara-data.js | 25 | Cloud storage, uploads and the file picker. |
Nookara Socialhttps://ikelene.net/gallery/extensions/nookara-social.js | 91 | Presence, direct messages, groups, friends, blocking and alerts. |
Nookara Profileshttps://ikelene.net/gallery/extensions/nookara-profiles.js | 39 | User lookup, arcade badges, achievements, account badges and login history. |
Nookara Voicehttps://ikelene.net/gallery/extensions/nookara-voice.js | 35 | Voice rooms and calls. Voice channels on Ember servers also need Nookara Chat. |
Nookara Chathttps://ikelene.net/gallery/extensions/nookara-chat.js | 307 | Ember servers, channels, messages, bots and game servers. |
Nookara Forumshttps://ikelene.net/gallery/extensions/nookara-forums.js | 8 | Read public communities, topics and posts. Read only, and it works without Nookara Login. |
Adding them in TurboWarp or PenguinMod
- Click Add Extension, then Custom Extension.
- Paste the Nookara Login URL from the table and turn on Run without sandbox.
- Do the same for each add-on you want. Sign in once with the Nookara Login blocks and every add-on is signed in.
Moving a saved project
The project converter takes a project using the old extension and gives you a copy that uses the new ones, with only the add-ons it needs. It runs in your browser and nothing gets uploaded. Keep your original until you've tried the copy.
Making your own add-on
Add-ons reach the sign-in through the runtime. There's nothing on window, and your add-on should look it up each time because Nookara Login may load after it.
const nookara = Scratch.vm.runtime.ext_ikelenenookaralogin?.api;
if (!nookara || nookara.version !== 1) throw new Error('Add the Nookara Login extension');
const token = nookara.getToken(); // null when signed out
const data = await nookara.http('/currency/balance');
nookara.requireScope(8192); // throws with a helpful message
nookara.on('login', () => { /* signed in */ });
nookara.on('message', frame => { /* every Nookara socket frame */ });
- Reading:
getToken,getUser,getUsername,getScopes,getDisabledScopes,getAccount,isAuthenticated,isConnected. - Requests:
httpreturns the JSON,cmdalso throws on errors and sets the latest operation result,requestdoes that for the chat routes with scope checks. - Socket:
ensureSocket,send, andonwithmessage,binary,connect,disconnect,loginorlogout.onreturns a function that stops listening.
Treat the token like a password: only send it to Nookara. The add-on uses the permissions of the app the person signed in with, so an add-on can't ask for more than that app did.
Questions
Do I have to switch?
No. The all in one Nookara extension keeps working and saved projects keep loading. It's still updated alongside these.
Does load order matter?
No. A project loads its extensions all at once, so add-ons find Nookara Login whenever it arrives. Until then an add-on's blocks say what's missing, and an Add Nookara Login button sits at the top of its blocks.
Why does it have to run without the sandbox?
Sandboxed extensions run on their own and can't reach each other, so an add-on couldn't use the sign-in from Nookara Login. Nookara Forums is the exception: it only reads public pages, so it works either way.
Can I use the old extension and an add-on together?
Don't. The add-ons use Nookara Login, so you would sign in twice with two connections. Move the project over instead.