1.3.0 ā€¢ Published 2 months ago

next-hubspot v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

ā­ Hubspot Forms for Next.js

Embed HubSpot forms into your Next.js application using hooks.

npm (scoped) Bundle Size type definition License: MIT

šŸŒ³ Tiny and Tree-Shakable

šŸ¦„ Written in TypeScript

šŸ‘¾ Works with multiple forms

šŸ˜Ž Uses next/script component

Install

yarn add next-hubspot

or

npm install --save next-hubspot

Getting Started

Wrap your application with HubspotProvider. This will add Hubspot script to your document. All props are passed directly to the Script tag, so you can use all props from the next/script documentation.

import { HubspotProvider } from 'next-hubspot';

const MyApp = ({ Component, pageProps }) => (
    <HubspotProvider>
      <Component {...pageProps} />
    </HubspotProvider>
)

Usage

import { useHubspotForm } from 'next-hubspot';

const HubspotForm = () => {
    const { loaded, error, formCreated } = useHubspotForm({
        portalId: 'XXXXXXX',
        formId: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
        target: '#hubspot-form-wrapper'
    });

    return (
        <div id="hubspot-form-wrapper" />
    )
}

All props are based on the HubSpot docs.

TypeScript

The module is written in TypeScript and type definitions are included.

Contributing

Contributions, issues and feature requests are welcome!

Show your support

Give a ā­ļø if you like this project!

LICENSE

MIT

1.4.0-beta.1

2 months ago

1.3.0

2 months ago

1.4.0-beta.0

2 months ago

1.2.0

6 months ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.5-canary.1

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.1.0-canary.2

1 year ago

1.1.0-canary.1

1 year ago

1.0.5-canary.1

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.4

2 years ago

1.0.3-canary.1

2 years ago

1.0.3

2 years ago

1.0.3-canary.2

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago