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

# Deployments

> This guide provides examples on how to integrate and manage application deployments using this SDK. You will learn how to create GitHub integrations, retrieve current integration details, and view the latest deployments using both the client and application objects.

## Create Integration

<Tabs>
  <Tab title="Using Client">
    ```python theme={null}
    import squarecloud as square

    client = square.Client(api_key='API KEY')


    async def example():
        webhook_url = await client.github_integration(
            'application_id', access_token='access_token'
        )
        print(
            webhook_url
        )
    ```
  </Tab>

  <Tab title="Using Application">
    ```python theme={null}
    import squarecloud as square

    client = square.Client(api_key='API KEY')


    async def example():
        app = await client.app('application_id')
        webhook_url = await app.github_integration(access_token='access_token')
        print(
            webhook_url
        )
    ```
  </Tab>
</Tabs>

## Obtaining Current Integration

<Tabs>
  <Tab title="Using Client">
    ```python theme={null}
    import squarecloud as square

    client = square.Client(api_key='API KEY')


    async def example():
        webhook_url = await client.current_app_integration(
            'application_id',
        )
        print(webhook_url)
    ```
  </Tab>

  <Tab title="Using Application">
    ```python theme={null}
    import squarecloud as square

    client = square.Client(api_key='API KEY')


    async def example():
        app = await client.app('application_id')
        webhook_url = await app.current_integration()
        print(
            webhook_url
        )
    ```
  </Tab>
</Tabs>

## Last Deploys

<Tabs>
  <Tab title="Using Client">
    ```python theme={null}
    import squarecloud as square

    client = square.Client(api_key='API KEY')


    async def example():
        deploys = await client.last_deploys('application_id')
        print(deploys)  # [[DeployData(...), DeployData(...), DeployData(...)]]
    ```
  </Tab>

  <Tab title="Using Application">
    ```python theme={null}
    import squarecloud as square

    client = square.Client(api_key='API KEY')


    async def example():
        app = await client.app('application_id')
        deploys = await app.last_deploys()
        print(deploys)  # [[DeployData(...), DeployData(...), DeployData(...)]]
    ```
  </Tab>
</Tabs>
