integrations

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Copyright © 2025 Vapi, Inc.

Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Authors:

Dan Goosewin <[email protected]>

Copyright © 2025 Vapi, Inc.

Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Authors:

Dan Goosewin <[email protected]>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateGoIntegration

func GenerateGoIntegration(projectPath string, info *ProjectInfo) error

GenerateGoIntegration creates Go files for Vapi integration

func GenerateNodeIntegration

func GenerateNodeIntegration(projectPath string, info *ProjectInfo) error

GenerateNodeIntegration generates SDK examples and configuration for Node.js/TypeScript projects

func GeneratePythonIntegration

func GeneratePythonIntegration(projectPath string, info *ProjectInfo) error

GeneratePythonIntegration generates SDK examples and configuration for Python projects

func GenerateReactIntegration

func GenerateReactIntegration(projectPath string, info *ProjectInfo) error

GenerateReactIntegration creates React/Next.js components and hooks for Vapi integration

Types

type Framework

type Framework string
const (
	// Frontend Frameworks
	FrameworkReact   Framework = "react"
	FrameworkVue     Framework = "vue"
	FrameworkAngular Framework = "angular"
	FrameworkSvelte  Framework = "svelte"
	FrameworkNext    Framework = "nextjs"
	FrameworkNuxt    Framework = "nuxtjs"
	FrameworkRemix   Framework = "remix"
	FrameworkVanilla Framework = "vanilla"

	// Mobile Frameworks
	FrameworkReactNative Framework = "react-native"
	FrameworkFlutter     Framework = "flutter"

	// Backend Languages/Frameworks
	FrameworkPython Framework = "python"
	FrameworkGolang Framework = "go"
	FrameworkRuby   Framework = "ruby"
	FrameworkJava   Framework = "java"
	FrameworkCSharp Framework = "csharp"
	FrameworkNode   Framework = "node"

	FrameworkUnknown Framework = "unknown"
)

type PackageJSON

type PackageJSON struct {
	Name            string            `json:"name"`
	Version         string            `json:"version"`
	Scripts         map[string]string `json:"scripts"`
	Dependencies    map[string]string `json:"dependencies"`
	DevDependencies map[string]string `json:"devDependencies"`
}

type ProjectInfo

type ProjectInfo struct {
	Path         string
	Framework    Framework
	ProjectType  ProjectType
	PackageJSON  *PackageJSON
	IsTypeScript bool
	HasTailwind  bool
	UsesPnpm     bool
	UsesYarn     bool
	UsesBun      bool
	BuildTool    string // vite, webpack, etc.

	// Backend specific fields
	PythonVersion string
	GoVersion     string
	JavaBuildTool string // maven, gradle
	DotNetVersion string
}

func DetectProject

func DetectProject(projectPath string) (*ProjectInfo, error)

DetectProject analyzes the current directory to detect project type

func (*ProjectInfo) GetAddCommand

func (p *ProjectInfo) GetAddCommand(pkg string) string

func (*ProjectInfo) GetFrameworkName

func (p *ProjectInfo) GetFrameworkName() string

func (*ProjectInfo) GetInstallCommand

func (p *ProjectInfo) GetInstallCommand() string

func (*ProjectInfo) GetPackageManager

func (p *ProjectInfo) GetPackageManager() string

func (*ProjectInfo) GetSDKInstallCommand

func (p *ProjectInfo) GetSDKInstallCommand() string

GetInstallCommand returns the install command for the SDK

func (*ProjectInfo) GetSDKPackage

func (p *ProjectInfo) GetSDKPackage() string

GetSDKPackage returns the appropriate Vapi SDK package for the framework

type ProjectType

type ProjectType string
const (
	ProjectTypeWeb     ProjectType = "web"
	ProjectTypeMobile  ProjectType = "mobile"
	ProjectTypeBackend ProjectType = "backend"
	ProjectTypeUnknown ProjectType = "unknown"
)

type ReactProject

type ReactProject struct {
	Path         string
	PackageJSON  *PackageJSON
	IsTypeScript bool
	IsNextJS     bool
	IsVite       bool
	HasTailwind  bool
}

func DetectReactProject

func DetectReactProject(projectPath string) (*ReactProject, error)

DetectReactProject analyzes the current directory to detect a React project

func (*ReactProject) GenerateEnvTemplate

func (rp *ReactProject) GenerateEnvTemplate() error

GenerateEnvTemplate creates a .env template with Vapi configuration

func (*ReactProject) GenerateVapiComponents

func (rp *ReactProject) GenerateVapiComponents() error

GenerateVapiComponents creates Vapi integration components

func (*ReactProject) InstallVapi

func (rp *ReactProject) InstallVapi() error

InstallVapi adds Vapi to the React project

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL