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

# コネクタの作成

> コネクタは、Base44 アプリを Google Calendar、Slack、Notion などの外部サービスに接続する OAuth インテグレーションです。接続後、バックエンド関数でアクセストークンを使用して外部 API を直接呼び出せます。

<Warning>
  このページは AI コーディングエージェントスキルの一部で、人間ではなくエージェント向けに書かれています。人間向けの Base44 ドキュメントは [デベロッパードキュメント](/developers) を参照してください。
</Warning>

# コネクタの作成

コネクタは、Base44 アプリを Google Calendar、Slack、Notion などの外部サービスに接続する OAuth インテグレーションです。接続後、バックエンド関数でアクセストークンを使用して外部 API を直接呼び出せます。

## 主要なコンセプト

* **直接 API アクセス**: コネクタは生の OAuth アクセストークンを提供します - バックエンド関数から外部 API を直接呼び出します
* **アプリビルダーのアカウント**: エンドユーザーのアカウントではなく、あなた (アプリビルダー) のアカウントを接続します
* **バックエンド関数のみ**: セキュリティのため、トークンはサーバー側でのみアクセスできます

## ファイルの場所

`base44/connectors/` ディレクトリ (または config.jsonc の `connectorsDir` で指定されたディレクトリ) にコネクタファイルを作成します。

**ファイル命名:** `{type}.jsonc` または `{type}.json`

例:

* `base44/connectors/googlecalendar.jsonc`
* `base44/connectors/slack.jsonc`
* `base44/connectors/notion.json`

## スキーマ

各コネクタファイルは `type` を指定し、オプションで `scopes` のリストを指定します:

```jsonc theme={null}
{
  "type": "googlecalendar",
  "scopes": [
    "https://www.googleapis.com/auth/calendar.readonly",
    "https://www.googleapis.com/auth/calendar.events"
  ]
}
```

### フィールド

| フィールド    | 型         | 必須  | 説明                                                                   |
| -------- | --------- | --- | -------------------------------------------------------------------- |
| `type`   | string    | はい  | インテグレーションタイプ (オプションを見るには `npx base44 connectors list-available` を実行) |
| `scopes` | string\[] | いいえ | 要求する OAuth スコープ (デフォルトは `[]`)                                        |

## 利用可能なコネクタタイプの発見

以下のコマンドを実行して、サポートされているコネクタタイプの最新リストを取得します。注意: `stripe` も有効なタイプですが、このコマンドからは返されません — サポート対象として扱います (下記の Stripe の例を参照)。

```bash theme={null}
npx base44 connectors list-available
```

これにより、利用可能なすべてのインテグレーション、その表示名、説明、および必要な接続構成フィールドを含む JSON オブジェクトが返されます。出力例 (省略):

```json theme={null}
{
    "integrations": [
        {
            "integration_type": "googlecalendar",
            "display_name": "Google Calendar",
            "description": "Access and manage Google Calendar events",
            "connection_config_fields": []
        },
        {
            "integration_type": "slack",
            "display_name": "Slack User",
            "description": "Send messages and interact with Slack as yourself (user integration)",
            "connection_config_fields": []
        },
        {
            "integration_type": "share_point",
            "display_name": "SharePoint",
            "description": "Manage documents, lists, sites, and collaboration content in SharePoint",
            "connection_config_fields": [
                {
                    "name": "subdomain",
                    "display_name": "SharePoint Site",
                    "description": "The name of your SharePoint site (e.g., sites/mysite)",
                    "placeholder": "sites/mysite",
                    "required": true,
                    "validation_pattern": "^[a-zA-Z0-9/_-]+$",
                    "validation_error": "Please enter a valid SharePoint site path"
                }
            ]
        }
    ]
}
```

出力の `integration_type` 値をコネクタファイルの `type` フィールドに使用します。一部のコネクタには追加の `connection_config_fields` が必要です — 出力で詳細を確認してください。

### Stripe (サンドボックス)

```jsonc theme={null}
// base44/connectors/stripe.jsonc
{
  "type": "stripe",
  "scopes": []
}
```

注意: Stripe は OAuth ブラウザーフローを必要としません。このコネクタをプッシュすると、Base44 はサーバー側で自動的に Stripe サンドボックスアカウントをプロビジョニングします。プッシュ出力にサンドボックスを Stripe アカウントにリンクするためのクレーム URL が含まれる場合があります。

## ルールと制約

1. **タイプごとに 1 つのコネクタ**: 同じタイプの複数のコネクタは持てません (例: 2 つの `googlecalendar` コネクタ)

2. **タイプは有効である必要があります**: `type` フィールドは有効なインテグレーションタイプである必要があります (利用可能なタイプを見るには `npx base44 connectors list-available` を実行)

3. **スコープはプロバイダー固有**: 各サービスには独自のスコープフォーマットがあります - プロバイダーのドキュメントを参照してください

## 次のステップ

コネクタファイルを作成したら、Base44 にプッシュします:

```bash theme={null}
npx base44 connectors push
```

これにより、新しい各 OAuth コネクタをブラウザーで認可するよう促されます。Stripe は例外で、ブラウザーフローなしで自動的にプロビジョニングされます。詳細は [connectors-push.md](https://docs.base44.com/developers/skills/base44-cli/references/connectors-push.md) を参照してください。

Base44 から既存のコネクタをローカルファイルにプルするには:

```bash theme={null}
npx base44 connectors pull
```

詳細は [connectors-pull.md](https://docs.base44.com/developers/skills/base44-cli/references/connectors-pull.md) を参照してください。

<Note>このページは AI を使用して翻訳されました。最も正確で最新の情報については、[英語版](/) を参照してください。 </Note>
