Hi Matthias,
Good question! Here are the necessary steps to transform an AX-library into an npm package on Github.
- Ensure that the project you are working on in SIMATIC AX is of type lib:
type : lib
- In the SIMATIC AX project, add your registry to the apax.yml file:
registries:
"@<accountname>": 'https://npm.pkg.github.com'
- Add the same account name before the library name in the apax.yml file:
name: "@<accountname>/example-library-name"
- Choose which files should be shipped with the library in the apax.yml file:
#Files, which will be shipped with the library
files:
- bin #to ship compiled files
- src #to ship source files
- Run the following commands:
apax build
apax pack
- Execute the apax login command and use the arrows to move to Custom NPM registries from apax.yml and catalogs and press enter. Leave the username field empty and press enter; in the password or token field, enter the previously created GitHub token.

- Run the following command:
apax publish --package <name-of-the-generated-filex.x.x.apax.tgz> --registry https://npm.pkg.github.com
- Go to your GitHub account, profile picture in the top right --> Your repositories --> Packages tab. Verify that the package has been published; change its visibility from Private to Public in Package settings.


The library is now available as a package! If you want to use this package in a new project:
- Add your registry to the apax.yml file:
registries:
'@<accountname>': 'https://npm.pkg.github.com'
- Login to GitHub using the apax login command. Important: for correct GitHub login, you need to enter the previously created token!
- Add the package running the command:
apax add @<username>/<libraryname>
I hope you find this useful! If you need any clarification, I'm here to help!
Greetings,
Benedetta