Lausnir

Fyrirtækið

Hafa Samband

Lausnir

Fyrirtækið

Hafa Samband

Lausnir

Fyrirtækið

Hafa Samband

Integration Guide

Mímir

Below is a short integration guide to adding an A.I. Assistant to your site.

HTML Example

Add the provided script tag to your HTML file. This script should be placed in the <head> section of your HTML document.

With IDENTIFIER replaced by your agent session identifier.

AND you pass the current page the chat agent is into the host field.

Please note that the current page must be an encoded string. This can be done using the encodeURIComponent function e.g

let encodedPageUrl = encodeURIComponent(PAGE_URL_STRING)

So a page like:

https:example.com?dimension=fetch&file=all

Is passed into the script like this:

https%3Aexample.com%3Fdimension%3Dfetch%26file%3Dall
<!DOCTYPE html>
<html>
<head>
  <script 
	async 
	src="https://agents.contextsuite.com/embedded/v1/main.js?identifier=IDENTIFIER&host=YOUR_WEBSITE"
>
</script>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
  <script 
	async 
	src="https://agents.contextsuite.com/embedded/v1/main.js?identifier=IDENTIFIER&host=YOUR_WEBSITE"
>
</script>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
  <script 
	async 
	src="https://agents.contextsuite.com/embedded/v1/main.js?identifier=IDENTIFIER&host=YOUR_WEBSITE"
>
</script>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
  <script 
	async 
	src="https://agents.contextsuite.com/embedded/v1/main.js?identifier=IDENTIFIER&host=YOUR_WEBSITE"
>
</script>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
  <script 
	async 
	src="https://agents.contextsuite.com/embedded/v1/main.js?identifier=IDENTIFIER&host=YOUR_WEBSITE"
>
</script>
</head>
</html>

Next.js Example

If you are using a frontend library like React or Vue.js, you can add the script according to the library documentation. 

For example, if you are using the React framework, Next.js, you would add this script to the root layout of your application like this

With IDENTIFIER replaced by your agent session identifier.

AND you pass your encoded website (see example above)

import Script from "next/script"

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang='en'>
      <body>
       {children}
      </body>
      <Script
        async
        src="https://agents.contextsuite.com/embedded/v1/main.js?identifier=IDENTIFIER&host=YOUR_WEBSITE"
      />
    </html>
  );
}
import Script from "next/script"

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang='en'>
      <body>
       {children}
      </body>
      <Script
        async
        src="https://agents.contextsuite.com/embedded/v1/main.js?identifier=IDENTIFIER&host=YOUR_WEBSITE"
      />
    </html>
  );
}
import Script from "next/script"

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang='en'>
      <body>
       {children}
      </body>
      <Script
        async
        src="https://agents.contextsuite.com/embedded/v1/main.js?identifier=IDENTIFIER&host=YOUR_WEBSITE"
      />
    </html>
  );
}
import Script from "next/script"

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang='en'>
      <body>
       {children}
      </body>
      <Script
        async
        src="https://agents.contextsuite.com/embedded/v1/main.js?identifier=IDENTIFIER&host=YOUR_WEBSITE"
      />
    </html>
  );
}