Another article in the “Launch – Make an Extension” series. See the other ones here: Overview, Setup, Coding, Debugging, on a Mac, and Reloaded
I had an hour or so of deep frustration the other day, when I tried to transition an Extension I had built from “Development” state (in which it can only be used in Properties that have the “[x] Configure for extension development (cannot be modified later)” option set) to “Private”, in which it can be used in the Experience Cloud Org that was used to upload it.
The latter is something I count on doing quite a lot with customers.
There were (or are) three pieces of documentation for this: the Private Extensions are Coming forum post by Ben Robison, the Releasing Your Extension chapter of the Getting Started doc, and the Release Private API doc.
I tried a bunch of things, none worked, and I decided that I will never fall in love with Postman. Sorry.
What worked for me was a combination of using the reactor-uploader, and some good, old-fashioned curl
, run on a Raspberry Pi, which was sitting on the desk next to me.
- Use the Adobe I/O Console &
curl
to generate an access token, and copy your API Key, - use @adobe/reactor-packager a& @adobe/reactor-uploader to package and upload the Extension package, and finally
- use
curl
to “release” the Extension package to “private” use.
If you are on a Mac, I presume you won’t need a Raspberry Pi. If you’re on Windows, und you can tell me where I can find a version of curl
that works with the calls listed below, please speak up!
Some further testing, and I can now report that curl
7.55.1, seemingly bundled with Windows 10, and curl
7.62, downloaded from haxx.se, work just fine on Windows, at least for step 1.
1 — Generate Access Token
This step involves your Adobe I/O Integration. You probably made this at some point whilst walking through either of the three documents listed above.
For this step, you need to a) be able to log into the Adobe I/O Console, and b) the contents of your private key file.
When you have successfully logged in, select your Integration from the list, or click the “View” button. You’ll be transported to the Integration Overview page.
Now head over to the tab named “JWT”.
You’ll see the page expand towards the bottom.
So, use the little “Copy” icon to copy the command, then paste it somewhere into a terminal, and run it. The output should look like this:
Depending on your terminal, it might be easier to just copy the lot into an editor, then remove everything but the access token. I am using the excellent ConEmu, which lets me copy parts of the text in the terminal pretty easily.
Ok. We have an access token. Onwards!
2 — Upload the Extension package
You will need the access token later in this step, but first, package your Extension using the packager.
The easiest way to do so is to move into your Extension directory, then issue the following command:
npx @adobe/reactor-packager
The command won’t really give any output, but once it has finished, you should have a ZIP file in your Extensions folder:
Well, the extension.json
contains a ‘name’ and a ‘version’ attribute, and those two are what make the package file name what it is.
In real life, you would likely upload to the integration environment, debug your Extension, and then eventually upload to production. I’ll show the steps for production, which only differ at one single point (you’ll see), because I want to show you how to turn your Extension to private in step 3.
You can now test your Extensions right on the production environment, so that’s what we’ll do.
Run the uploader, like this:
npx @adobe/reactor-uploader
The uploader will ask you a bunch of questions:
Which environment do you want to use? Select “Production”
So when you’re happy with it, and you want to use it in your Experience Cloud only, then this is the time to set it to “private”.
3 — Release your Extension, privately
This step is just one curl
command, but I suggest you use an editor to make it.
The base code looks like this:
curl https://mc-api-activation-reactor.adobe.io/extension_packages/<your Extension Package ID> -H "Accept: application/vnd.api+json;revision=1" -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer <your access token>" -H "X-Api-Key: <your API key>" -X PATCH -d '{ "data": { "attributes": {}, "meta": { "action": "release_private" }, "id": "<your Extension Package ID>", "type": "extension_packages" } }'
If you put that into an editor, replace the four(!) “<your something>” placeholders correctly, then run the command, you should be seeing something like this:
curl
I used, so I did this ony my trusty Raspberry Pi.
Your Extension is now live on Launch, and you should be able to see it in all your Properties.
Notes
I know what you’re thinking, and you’re right. These steps are nowhere near easy enough.
There is too much c&p going on, and a lot of it should be automated.
I’m hoping that someone will create a tool, and if or when that happens, I shall let you all know.
If you think your Extension would benefit more people, you can decide to make it public, or rather you can ask my colleagues to release it publicly.
Use the Public Release Request Form to ask to get it released.
Yes, do it!
Regarding the Pi on the desk: I configured it so it logs into hotel wifi and in turn provides wifi for all my devices, allowing me to use a Chromecast when I’m travelling. I also use it on site.
In the picture above, it was sitting on the desk of a Swiss bank, one of my most cherished customers. It’s funny how very few people asked me what on Earth a Pi was doing on the desk.
In this case, I was really glad I had it with me!
Raspberry Pis are cool. You can never have enough Raspberry Pis.
Hi Jan,
I think one of below will do the job for Windows:
* https://curl.haxx.se/windows/
* http://www.cygwin.com/
Thanks,
Dimitris
LikeLike
Hi Dimitris,
I tried with cygwin, but to no avail. On my machine, it looks as if cygwin is using the same version of curl as windows, 7.55.1, with the same result.
The one from haxx.se doesn’t want to send the request, either.
But I frankly admit that I haven’t yet tested thoroughly, and so there will likely be an update to this article at some point 😉
Thanks!
Jan
LikeLike