Create new inbox

Hey there! I’m actually working on documentation now for how the React SDK sample application demonstrates things like this. I still think that is likely the best example for now, but a few things to note:

First, Solid pods get inboxes created when you register a new pod, so there will always be a global inbox. You can see what an inbox is in Solid by looking there - and essentially, it’s just a regular container. The only difference is an inbox is linked from somewhere via ldp:inbox predicate, as you can see on your profile card. All new Solid users should have this.

In the SDK we decided that global inbox isn’t enough, we want more granular control over inboxes, so we created our own. Our path, as described in the generated application, is /public/games/ticttactoe, and there we initialize a bunch of stuff: data.ttl file, which links out to external games, settings.ttl which stores game settings, and /inbox container. We link to the full /public/games/tictactoe/inbox path in settings.ttl using ldp:inbox (in theory you can move this inbox anywhere as long as it is linked from settings.ttl).

Some of the sample code creating an inbox in the Tic Tac Toe game can be seen here.

You’re right that there are three params (the last is optional):

inboxPath is the full path to where you want the inbox to be, so for example https://mypod.provider.com/public/inbox.
appPath is the root path where your app data is stored, for example https://mypod.provider.com/public/myAppData
settingFileName is the optional param, and this is the file where your ldp:inbox link goes. By default it will be settings.ttl stored in the appPath container. You can change the name here if you want.

Once all these are in place, the createInbox function will create the new inbox (if it doesn’t exist), create settings,ttl (if it doesn’t exist) and then link the inbox in settings.ttl via ldp:inbox for you.

2 Likes