> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbitroblox.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# API Usage

To properly use API, you need permissions on your extension.

Create your Permission Values inside `Permissions`. In this example, we will just give ourselves full permission:<br />  • Root (BoolValue, true)

Which then should look like this:

<Frame>
  <img src="https://mintcdn.com/orbitroblox/wwoOD6zWcKGOvoge/images/permission-example.png?fit=max&auto=format&n=wwoOD6zWcKGOvoge&q=85&s=5381c6d7f63d52a6abd6ae8d4d49c1c3" alt="Example of permissions" width="275" height="103" data-path="images/permission-example.png" />
</Frame>

For more information on Permissions, look up [this page](/permissions)

<Note>
  Functions that start with a `_` (underscore) are usually exposed internal functions and should not be used if you don't know what they do.
</Note>

## Shared

* `manifest`<br />A table on all the attributes you set in the extension.
* `capabilities`<br />Another table, this time with the permissions.
* `remotes`<br />Allows you to access the Remotes for Orbit's namespace.<br />Uses `ByteNet-Max`.<br />More Information in the future.
* `Notify`<br />An API that you always have access to.<br />Allows you to send notifications.<br />Leave out target if on client.

```luau theme={null}
export type onelinerData = {
	message: string,
	icon: string?,
	duration: number?,
}

function notify:oneliner(target: Player?, data: onelinerData) : boolean
```

```text theme={null}
export type twolinerData = {
	title: string,
	description: string,
	icon: string?,
	duration: number?,
}

function notify:twoliner(target: Player?, data: twolinerData) : boolean
```

* `Logger`<br />Debug API. Instead of prints we have a centralized log that prints by entering `--orbit logs` into the console.

```luau theme={null}
function logger.Log(content: string) : boolean
function logger.Get(lines: number) : {[number]: string}
```

## Server

* `permitted(userId: number, permission: string)`<br />A function exposed to check for permission. To see if someone has access to the panel, simply check for the `Active` permission.
* `info`<br />A configuration instance provided, that allows you to read following info (through attributes):<br />  • `thumbnail` The game's thumbnail.<br />  • `description` The game's description.<br />  • `icon` The game's icon.<br />  • `serverCode` The server code generated by networking. (Keep in mind this will not be changed if Networking is disabled)<br />  • `uptime` Uptime tracked by Orbit.<br />  • `version` The version of Orbit currently running.

## Client

* `contextmenu`<br />Allows usage of the context menu.

```luau theme={null}
export type ContextMenuData = {
	Header: string,
	Buttons: {
		{
			Icon: string,
			Label: string,
		}
	},
}
export type SignalInstance = {
	Connect = function(self, callback: () -> ()),
	-- ...
}
export type Events = {
	isHovering: boolean,
	isInitialized: boolean,
	ContextMenuOpened: boolean,
	ButtonClicked: SignalInstance,
}
contextmenu:ContextMenu(State: boolean, Data: ContextMenuData?) : Events|{}
```

* `breadcrumbs`<br />Self-explanatory.
  ```luau theme={null}
  breadcrumbs:_jumpTo(crumbs: {string})
  breadcrumbs:crumb(data: string, fromRoot: boolean?)
  ```
  <Note>
    The data on `crumb` **can** be formatted like this: `Extension/Settings`, or just `Settings`. FromRoot will set the crumb to `Orbit/` and continue from there. **Modals and Navkit do this automatically!**
  </Note>

## Client (Permission-based)

* `navkit` (UseNavkit)
  ```luau theme={null}
  function navkit:_jumpToPage(button: ImageButton)
  function navkit:_bind(button: ImageButton)
  export type catdata = {
  	name: string,
  	layoutorder: number?,
  }
  function navkit.newCategory(identifier: string, catdata: catdata)
  function navkit.getCategory(identifier: string)
  export type navdata = {
  	category: string,
  	name: string,
  	icon: string?,
  	layoutorder: number?,
  	clone: boolean?,
  }
  function navkit.newButton(identifier: string, navdata: navdata, window: GuiObject)
  function navkit.deleteButton(identifier: string, category: string)
  ```
  We recommend keeping category identifiers like this: `extension.category`.<br />A perfect example is Orbit's categories.<br />The `Main` category is under `orbit.main`, and `More` is under `orbit.more.`<br />Both get created at runtime using `.newCategory`.
  <Frame>
    <img src="https://mintcdn.com/orbitroblox/wwoOD6zWcKGOvoge/images/navbar.png?fit=max&auto=format&n=wwoOD6zWcKGOvoge&q=85&s=63d4552d52b0e0d180ac906b86e99021" alt="Example of navbar" width="211" height="421" data-path="images/navbar.png" />
  </Frame>
* `modals` (UseModals)
  ```luau theme={null}
  function modalService.new(id: string, modal: GuiObject, constructor: ((modal: GuiObject, ...any) -> ())?) : GuiObject
  function modalService:switchTo(modal: string|GuiObject, data: {any}) : boolean
  function modalService:back()
  ```
