# Service Buttons

Service buttons allow you to create additional tabs in your application's interface by writing specially formatted messages to stderr. These tabs can either link to external URLs or embed content directly.

### Basic Usage

To display a service button, print a message to stderr in the following format:

```
::show-service-button::{options}
```

#### Required Options

* `url` (string): The URL the button should link to or embed
* `name` (string): The display name for the button

#### Optional Options

* `embed` (boolean): When set to `true`, embeds the URL content inline instead of showing a button. Default: `false`
* `style` (string): Alternative way to set embed mode using `style: "embed"`

### Examples

#### Basic Button Tab

Create a tab that links to an external URL:

```python
import sys
print('::show-service-button::{"url":"http://example.com/","name":"Example"}', file=sys.stderr)
```

<figure><img src="https://4109720758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ff3mjTRQNkASbnMbJqzJ2%2Fuploads%2Fgit-blob-886e7205d7eaf6ad6c2515f7b067d9efa9b8a713%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Embedded Content Tab

Create a tab with embedded content displayed directly:

```python
import sys
print('::show-service-button::{"url":"https://dashboard.example.com/","name":"Dashboard",embed:true}', file=sys.stderr)
```

Or using the `style` parameter:

```python
import sys
print('::show-service-button::{"url":"https://dashboard.example.com/","name":"Dashboard",style:"embed"}', file=sys.stderr)
```

<figure><img src="https://4109720758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ff3mjTRQNkASbnMbJqzJ2%2Fuploads%2Fgit-blob-639807bc2f2261e11fff27995c9ce7f88daa9d09%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### Important Notes

* Service button commands **must** be written to **stderr**, not stdout
* Each service button creates a new **tab** in the interface
* The JSON options should be valid JSON format (use double quotes for strings)
* Tabs with `embed: true` will display the content inline, while regular tabs will link to external URLs
