---
url: https://talkjs.com/docs/UI_Components/JavaScript/Classic/Installation
---

# JavaScript Chat SDK

Ask a question Copy for LLM [View as Markdown](/docs/UI_Components/JavaScript/Classic/Installation.md)
Our JavaScript SDK allows you to easily add chat to your app.
You can install the SDK into your site in two ways:

## 1. Copy & paste

Put the code below in your app's `<head>` or at the very end of the `<body>`.

HTML

```html
<script>
(function(t,a,l,k,j,s){
s=a.createElement('script');s.async=1;s.src="https://cdn.talkjs.com/talk.js";a.head.appendChild(s)
;k=t.Promise;t.Talk={v:2,ready:{then:function(f){if(k)return new k(function(r,e){l.push([f,r,e])});l
.push([f])},catch:function(){return k&&new k()},c:l}};})(window,document,[]);
</script>
```

Make sure you include it on every page of your app, so that TalkJS's notification features work correctly.

## 2. Use NPM

If you use a bundler for your client-side JavaScript, such as Webpack, Browserify or Parcel,
you can use NPM to import TalkJS into your app:

```bash
npm install talkjs --save

# or, if you use yarn
yarn add talkjs
```

In your code, in place that is loaded on every page, do:

```javascript
const Talk = require('talkjs');

// or, if you use ES6 or TypeScript
import Talk from 'talkjs';
```

Our NPM package ships with TypeScript type definitions,
which means you'll get auto-completion on certain editors (such as Visual Studio Code or Atom):

## TalkJS loads fast

The core TalkJS SDK is small and loads asynchronously, so that your page load times aren't impacted.
TalkJS is served from our global CDN to ensure fast load times across the globe.