Swell
  • Product
  • Solutions
  • Developers
  • Resources
  • Pricing
  • Contact
  • Log in
  • Sign up
  • Product

  • Pricing
  • Try for free
  • Log In
  • Building

  • Merchandising

  • Operations

  • Integrations

  • Headless storefronts

    Swell's powerful APIs allow you to create multiple storefronts for any architecture and tech stack.

  • Checkouts

    Use our hosted checkout, integrate with a partner, or build a custom flow.

  • Payments

    Connect multiple gateways simultaneously, store cards, and split payments.

  • Internationalization

    Go global with region-specific languages, pricing, and payment methods.

  • Content management

    Manage all your products content through the admin dashboard

  • Products

    Powerful modeling and versatile presentation of your entire catalog.

  • Subscriptions

    Sell recurring physical and virtual products alongside one-time offerings.

  • Conversion

    Get the sale with coupons, BXGY promotions, and automatic discounts.

  • Wholesale

    Sell B2B like it’s DTC, along with volume pricing, customer groups, and invoicing.

  • Users

    Multi-store admin accounts and role-based permission controls.

  • Customers

    Manage customer info, generate reports, and see buyer activity.

  • Orders

    Edit orders anytime and get the right information for smooth fulfillment.

  • Fulfillment

    Ship from multiple locations, track inventory, and split shipments.

  • Reporting

    Monitor your store’s performance to ensure you have visibility across the business.

No-code integrations

Connect with 40+ services for marketing, payments, fulfillment, automation, and more.

See all integrations →
zapier logo
yotpo logo
vercel logo
taxjar logo
stripe logo
slack logo
shipstation logo
sendgrid logo
resolve logo
quickpay logo
zapier logo
yotpo logo
vercel logo
taxjar logo
stripe logo
slack logo
shipstation logo
sendgrid logo
resolve logo
quickpay logo
zapier logo
yotpo logo
vercel logo
taxjar logo
stripe logo
slack logo
shipstation logo
sendgrid logo
resolve logo
quickpay logo
omnisend logo
mailchimp logo
klaviyo logo
klarna logo
hubspot logo
contentful logo
braintree logo
bancontact logo
avalara logo
algolia logo
omnisend logo
mailchimp logo
klaviyo logo
klarna logo
hubspot logo
contentful logo
braintree logo
bancontact logo
avalara logo
algolia logo
omnisend logo
mailchimp logo
klaviyo logo
klarna logo
hubspot logo
contentful logo
braintree logo
bancontact logo
avalara logo
algolia logo

Use Cases

  • Direct-to-consumer

    Tell your story and give customers a unique shopping experience

  • Subscriptions

    Sell personalized subscription bundles, memberships, and one-time items together

  • B2B/B2C

    Support retail and wholesale customers from one catalog and dashboard

  • Marketplaces

    Create a B2B or B2C marketplace with multi-vendor carts and split payouts

Customer Stories

    All customer stories →

    Documentation

    • Quickstart

    • Backend API reference

    • Frontend API reference

    • Guides

    • Core concepts

    • Storefronts

    Community

    • GitHub

    • Discussion forum

    • Discord

    • Changelog

    • API status

    Resources

    • Help Center

      The latest industry news, updates and info.

    • Customer stories

      Learn how our customers are making big changes.

    • Become a partner

      For agencies creating innovative commerce experiences.

    Latest blog posts

    All blog posts →
    • Changelog

    • API Status

    • Contact us

    Blog / Build your ecommerce store with Next.js Commerce and Swell on Next 13

    Build your ecommerce store with Next.js Commerce and Swell on Next 13

    Discover the simple steps to build and launch an ecommerce website by leveraging Next.js, Swell, and Next.js Commerce.

    February 23, 2023

    This guide provides an overview of how to quickly create high-performance ecommerce websites on Swell using Next.js Commerce. With this starter kit, you can clone, customize, and deploy your own store in just a few clicks.

    And for more, be sure to watch this tutorial by Hamed Bahram of Monogram on the same topic: Build an e-commerce store using NextJs 13 and Swell.

    Next.js Commerce

    Next.js Commerce offers a range of benefits, such as image optimization rendering, internationalization, and analytics reporting. It also includes advanced features like incremental static generation, eliminating the need to manual trigger webhooks. It also simplifies the development process by providing a fully styled UI components for core ecommerce functionality, and automatically generating default settings for Swell.

    This guide uses Vercel as a hosting solution—Vercel offers hassle-free asset serving through the CDN and seamless integration with Next.js' automatic static optimization and API routes.

    Getting started

    First, create a store in Swell. Hit this link and follow the signup steps.

    Once you’ve created an account, you’ll need to deploy Next-Commerce directly from Vercel.

    Clone and Deploy

    1. Click this magic button to deploy the starter kit directly to Vercel.

    2. Create a git repository on Github, Gitlab, or Bitbucket. You might need to set up further permissions if prompted.

    Image showing how the steps to create a new Git repository in vercel

    3. Give your new repository a name, and click Create.

    Image showing the necessary fields to create a new repository in vercel

    4. In the Add Integrations step, click Add to connect Swell to your project.

    Image showing the multiple integrations that vercel offers

    5. Click Connect to an existing store. Alternatively, you can also create a new account.

    Image prompting to connect Vercel with Swell

    6. Insert your Swell store domain, and hit Authorize integration.

    Image prompting te user to connect their swell store and authorize the integration.

    7. By clicking Allow, you grant Vercel access to all the necessary information required to connect with your store. This prompt will display everything that is needed for this connection.

    Image showing all the information that Vercel needs to access to in Swell.

    8. You’re done! 🎉 You’ve successfully deployed your project on Vercel.

    Image showing that vercel's set up has been completed.

    Running the project locally

    To customize your store, you’ll need to make some changes locally. Make sure you’re running git and node.js in your system. Next-Commerce uses pnpm as a package manager — which is up to 2x faster than yarn or npm and more efficient.

    In the repository you’ll find a monorepo with the following directory structure:

    • packages/
      • commerce/: This is the base definition to serve for all the providers.
      • swell/: The provider for Swell.
    • site/: Next.js website.
      • components/ : Shared components
      • pages/ : Individual pages
      • assets/ : CSS styling configuration

    Clone the repository and run this command to install:

    $ pnpm install & pnpm build

    Once you have cloned the project, you’ll need to create a .env file based on the .env.template provided within the project. The file requires your Swell Store ID and your public API key — both of which can be found in the Swell dashboard under Developer > API Keys.

    In the .env, provide your Swell Store ID and public API key in the following format:

    COMMERCE_PROVIDER=@vercel/commerce-swell
    NEXT_PUBLIC_SWELL_STORE_ID=XXXXXXX
    NEXT_PUBLIC_SWELL_PUBLIC_KEY=XXXXXXX

    With the .env file configured with your Swell store information, you’re ready to deploy your storefront. Fill out any additional settings or configurations, and you're ready to deploy on your hosting provider of choice.

    And to run the dev server:

    $ pnpm dev

    Customization

    After setting up Next.js Commerce and Swell, you have all the necessary information to begin building a complete ecommerce storefront with all the required UI elements. The next step is to personalize and tailor it to their specific needs.

    Navigation

    To begin, set your own custom logo. You can set it by customizing Logo.tsx

    This will set a custom logo on every part of your storefront.

    const Logo = ({ className = '', ...props }) => (
      <svg
        width="32"
        height="32"
        viewBox="0 0 32 32"
        fill="none"
        xmlns="http://www.w3.org/2000/svg"
        className={className}
        {...props}
      >
       // some custom SVG
      </svg>
    )
    
    export default Logo

    Footer

    The footer of the storefront is still using its demo data. Here’s how to quickly change that.

    const year = () => {
      const date = new Date()
      return date.getFullYear()
    }
    
    <div className="pt-6 pb-10 flex flex-col md:flex-row justify-between items-center space-y-4 text-accent-6 text-sm">
      <div>
        <span>&copy; {year()} Swell, Inc. All rights reserved.</span>
      </div>
    </div>

    Theme

    To personalize the website, you can modify the Tailwind configuration. The storefront's appearance is created using TailwindCSS, a convenient CSS framework for rapidly developing interfaces. You can further customize the theme using the tailwind.config.js file.

    // tailwind.config.js
    primary: 'var(--primary)',
    'primary-2': 'var(--primary-2)',
    secondary: 'var(--secondary)',
    'secondary-2': 'var(--secondary-2)',
    hover: 'var(--hover)',
    'hover-1': 'var(--hover-1)',
    'hover-2': 'var(--hover-2)',
    'accent-0': 'var(--accent-0)',
    'accent-1': 'var(--accent-1)',
    'accent-2': 'var(--accent-2)',
    'accent-3': 'var(--accent-3)',
    'accent-4': 'var(--accent-4)',
    'accent-5': 'var(--accent-5)',
    'accent-6': 'var(--accent-6)',
    'accent-7': 'var(--accent-7)',
    'accent-8': 'var(--accent-8)',
    'accent-9': 'var(--accent-9)',

    Next.js Commerce sets most of the theme settings from CSS Variables. These are being set in the /site/assets/base.css file:

    :root {
      --primary: #ffffff; // Primary Colors
      --primary-2: #f1f3f5;
      --secondary: #000000;
      --secondary-2: #111;
      --selection: var(--cyan);
      --text-base: #000000;
      --text-primary: #000000;
      --text-secondary: white;
      --hover: rgba(0, 0, 0, 0.075); // Hovers
      --hover-1: rgba(0, 0, 0, 0.15);
      --hover-2: rgba(0, 0, 0, 0.25);
      --cyan: #22b8cf;
      --green: #37b679;
      --red: #da3c3c;
      --purple: #f81ce5;
      --blue: #0070f3;
      --pink: #ff0080;
      --pink-light: #ff379c;
      --magenta: #eb367f;
      --violet: #7928ca;
      --violet-dark: #4c2889;
      --accent-0: #fff;   // Accent Colors
      --accent-1: #fafafa;
      --accent-2: #eaeaea;
      --accent-3: #999999;
      --accent-4: #888888;
      --accent-5: #666666;
      --accent-6: #444444;
      --accent-7: #333333;
      --accent-8: #111111;
      --accent-9: #000;
      --font-sans: -apple-system, system-ui, BlinkMacSystemFont, 'Helvetica Neue',
        'Helvetica', sans-serif; // Set Fonts
    }

    Next.js Commerce also has a dark theme—you can set your own colors through the following:

    [data-theme='dark'] {
      --primary: #000000;
      --primary-2: #111;
      --secondary: #ffffff;
      --secondary-2: #f1f3f5;
      --hover: rgba(255, 255, 255, 0.075);
      --hover-1: rgba(255, 255, 255, 0.15);
      --hover-2: rgba(255, 255, 255, 0.25);
      --selection: var(--purple);
      --text-base: white;
      --text-primary: white;
      --text-secondary: black;
      --accent-9: #fff;
      --accent-8: #fafafa;
      --accent-7: #eaeaea;
      --accent-6: #999999;
      --accent-5: #888888;
      --accent-4: #666666;
      --accent-3: #444444;
      --accent-2: #333333;
      --accent-1: #111111;
      --accent-0: #000;
    }

    Conclusion

    We have only just begun to explore all that Next.js Commerce has to offer. There is still a lot more for us to discover and develop with Swell and Next Commerce. We are actively striving to improve our own SDK to be used by many platforms and to include all the features that Swell offers.

    Follow us on Twitter and get involved in our discussions for the latest updates.

    Up next

    ProductNews

    16 reasons to adopt a headless commerce approach

    0November 04, 2022
    Join our mailing listGet the latest from Swell,
    right to your inbox
    Swell
    Next-level commerce for everyone.
    • Twitter
    • LinkedIn
    • GitHub
    • Discord

    Subscribe to our newsletter for product updates and stories.

    Explore
    • Features
    • Pricing
    • Enterprise
    • Integrations
    • Customer stories
    • What is headless?
    Compare
    • Shopify
    • BigCommerce
    Use cases
    • Subscriptions
    • B2B wholesale
    • Marketplaces
    • Omnichannel
    • Direct-to-consumer
    Developers
    • Why Swell?
    • Documentation
    • Guides
    • Storefronts
    Resources
    • Help Center
    • Developer Center
    • Community
    • Agencies
    • Changelog
    • Customer stories
    Company
    • Blog
    • About us
    • Jobs
    • Partners
    © 2025 Swell. Made worldwide.
    • Privacy policy
    • Terms of service
    Everything is swell