# Cách cài đặt live chat trên website Gatsby?

> Tami · Cập nhật lần cuối ngày 10 thg 4, 2024

Nếu bạn có website được tạo trên Gatsby, bạn có thể thêm widget live chat của SquareHub và trò chuyện với khách truy cập theo thời gian thực. Việc này có thể thực hiện trong 3 bước đơn giản bằng plugin Gatsby của SquareHub.

## Bước 1. Thêm plugin Gatsby vào dự án của bạn[​](https://docs.squareomni.com/docs/product/channels/live-chat/integrations/gatsby#1-add-the-gatsby-plugin-to-your-project "Direct link to heading")

Thêm `gatsby-plugin-squarehub` vào dự án Gatsby của bạn.

```
npm install --save gatsby-plugin-squarehub
```

Nếu bạn đang dùng yarn, hãy sử dụng lệnh sau:

```
yarn add gatsby-plugin-squarehub
```

## Bước 2. Thêm plugin vào file cấu hình Gatsby của bạn[**​**](https://docs.squareomni.com/docs/product/channels/live-chat/integrations/gatsby#2-add-the-plguin-to-your-gatsby-config-file "Direct link to heading")

```
// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-squarehub`,
    options: {
      baseUrl: "BASE_URL", // Required
      websiteToken: "WEBSITE_TOKEN", // Required
      includeInDevelopment: false, // Optional
      squarehubSettings: {}, // Optional
    },
  },
];
```

Bạn có thể lấy Website token và base URL từ cài đặt Inbox trong tài khoản SquareHub của mình.

Nếu bạn cần tạo kênh website mới, hãy làm theo quy trình được minh họa [tại đây](https://docs.squareomni.com/hc/squarehub-user-guide-cloud-version/en/website-live-chat/474).

## Bước 3. Khởi động máy chủ của bạn[**​**](https://docs.squareomni.com/docs/product/channels/live-chat/integrations/gatsby#3-start-your-server "Direct link to heading")

Bây giờ bạn sẽ có thể thấy widget SquareHub trên trang.
