# Embedded / Introduction

# Embedded API

Shopfront allows you to embed your own application within the point of sale system. You can add custom navigation,
buttons, pages and more.

At the moment this API is quite young and may unexpectedly break, so you should use it with care. We currently
use the embedded API to handle all of our built-in integrations (Xero, MYOB, ALM, etc).

## Using the Embedded API

The Embedded API injects a single script into the Shopfront POS interface and communicates with the script via a hook
system (your script registers callbacks to be fired when Shopfront is rendering or performing a certain action).

The easiest (and recommended) way to register for hooks and communicate with Shopfront is via the 
[Shopfront Embedded Bridge](/documentation/Embedded/Bridge).

## Registering Your Application Script

When you're ready to start using the Embedded API you simply need to do the following:

- Sign up for a developer account (or log in if you already have one)
- Create a new application
  - Name your application
  - Set a valid redirect URI
  - Save the application
- Press the edit button next to the application
- Add the URI to your script under "Embedded API URI"
  - The URI must be able to communicate through an iframe
- Save the application

Now that the script has been registered you can add it to Shopfront:

- Open Shopfront
- Perform the authentication flow
- Go back to Shopfront

Your script should now be registered and can perform actions.

## Validating Requests

We would highly suggest validating all requests from your embedded application using
[Shopfront authentication tokens](/documentation/Embedded/Authenticating) to prevent third-parties from calling your
API without authentication.