header-logo
Getting started with WixBuild your website and business with Wix. Try using our AI tools to create your website, customize templates, or hire professionals to build or enhance your online presence.
Creating a websiteRead how to use the Wix Editor and manage content on your site. Discover how to protect your visitors' privacy and make your site accessible.
Account & billingReview your account settings, manage your subscriptions and plans and understand your invoices.
Using the Wix mobile appsUse our mobile apps to run your business efficiently on the go and set up a dedicated app for your site members to stay in touch.
Connecting a domainFollow our step-by step guides to learn how to purchase, connect or transfer a domain for your site, and find out how to keep your site’s data secure.
Managing your businessGet tools to grow your business and web presence. Find the right tools for your specific needs, set up online payments and keep track of your site's analytics.
Promoting your siteLearn to make your site more visible promoting it on search engines, sending emails and running paid ads. Improve your online presence with practical tips.
Studio, Partners & EnterpriseGet the most out of your Studio or Enterprise account with advanced features that'll help you work more efficiently.
Need more help?Find solutions for site performance and technical issues, learn about issues we’re working to fix or contact us for help.
placeholder-preview-image
Wix LearnImprove your skills with our courses and tutorials.
Wix BlogGet tips for web design, marketing and more.
SEO Learning HubLearn to increase organic site traffic from search engines.
Website developmentBuild a custom site using our full-stack platform.
Hire a ProfessionalGet matched with a specialist to help you reach your goals.
placeholder-preview-image
In this article
  • Namespace prefix
  • Account name
  • Company name
  • Namespace suffix
  • Using your namespace for collections
  • Using your namespace to import functions

Wix Blocks: Creating a Namespace for Your App

In this article
  • Namespace prefix
  • Account name
  • Company name
  • Namespace suffix
  • Using your namespace for collections
  • Using your namespace to import functions

A namespace is a unique indicator of your app, in the format of:

@prefix/suffix

The prefix is either your account name or your company name. The suffix usually indicates your app name.

You need a namespace to:

You don't need a namespace to:
  •  Create widget-only apps with no backend or public code, or collections).
Important
Once you create a namespace you cannot change it.

Namespace prefix

There are two options for the prefix of your namespace. It can either start with your account name or with your company name. 

Account name

Your account name is your Wix user name. If you are a Wix Partner, it's your Wix Partner account name. For this option, your namespace format is:

@your-account-name/your-app-name

Company name

Your company name is defined in your Company Info in the Wix Developers Center. Use this option if you plan to publish your app in the Wix App Market. For this option, your namespace format is:

@your-company-name/your-app-name
Company name requirements for namespace
  • A company name that you put in your namespace must be unique in Wix. If someone used your company name and you think it might involve trademark infringement, please let us know.
  • Your namespace can only include latin letters and numbers. If your company name includes non-latin letters, you'll need to change it in the Wix Developers Center to use it as the prefix of a namespace. 
  • If you change your company name in the Wix Developers Center, it will change the namespace of all future applications in your account.

Namespace suffix

You can change the suffix of your namespace as you wish. Just follow these requirements:

  • Use only lower-case letters, and numbers.
  • No special characters or spaces.
  • Must be unique within your account.

Using your namespace for collections

To use your namespace for a collection, add the collection ID after the namespace, as shown here on line 11:
1import wixData from 'wix-data';
2
3// ...
4
5let toInsert = {
6  "title":        "Mr.",
7  "first_name":   "John",
8  "last_name":    "Doe"
9};
10
11wixData.insert("@yourAccountName/yourApp/yourCollection", toInsert)
12  .then( (results) => {
13  let item = results; //see item below
14 } )
15 .catch( (err) => {
16  let errorMsg = err;
17 } );

Using your namespace to import functions

To import a public function from your app's code files, use this syntax:

import {yourFunctionName} from '@yourAccountName/yourAppName'

For example:

1import {getStock} from '@nathanb257/stockquotesfromapi';
2
3$w.onReady(function (){
4  getStock()
5});

To import from backend files, use this syntax:

import {yourFunctionName} from '@yourAccountName/yourAppName-backend'

For example:

1import { getStock } from '@nathanb257/add1-backend';

Helpmate

Hello

Need a bit more guidance?
Unlock personalized helpLog in to get the most out of Helpmate.