How It Works
- Add a
<script>tag to your page with the URL of your DSL file. - The script renders a branded “Publish to ABMLib” button.
- When clicked, it opens the ABMLib publish page with your DSL pre-loaded, ready for the user to review, add metadata, and publish.
HTML Snippet
Copy the snippet below and replace the data-dsl-url value with the URL of your DSL JSON file.
<script
src="https://abmlib.dev/embed/publish-button.js"
data-dsl-url="https://example.com/my-blueprint.json"
></script>Configuration
| Attribute | Required | Description |
|---|---|---|
| data-dsl-url | Yes | The publicly accessible URL of your DSL JSON file. The publish page will fetch this URL client-side, so the remote server must allow cross-origin requests (CORS). |
Preview
This is how the button will appear on your page:
CORS Requirements
When a user clicks the button, the ABMLib publish page fetches the DSL from your URL using a client-side fetch() request. The remote server hosting the DSL file must respond with an Access-Control-Allow-Origin header that permits requests from https://abmlib.dev. If the remote server does not support CORS, the user will see an error and can paste the DSL manually instead.