This package has been deprecated

Author message:

Moved to @vendasta/core

@vendasta/country-state-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Country-State SDK

This provides a service to retrieve country/state data.

Requirements

Install to your project:

npm install @vendasta/country-state-sdk --save

Next, you will need to import and setup your navigation module (generally in app.module.ts)

import { CountryStateModule } from "@vendasta/country-state-sdk";

@NgModule({
  
  imports: [
    , CountryStateModule, 
  ]
})

The Country-State sdk currently requires two endpoints be provided by the client's domain, one to retrieve the list of countries, and one to retrieve the list of states given a country. These endpoints are easily implemented in python as simple wrappers around vautil (see VBC for example).

Future work should direct these calls to a common microservice or source of data.

Methods

getCountriesOptions(): Promise<Country[]>

Returns a promise of a list of countries (name and ISO-3166 alpha-2 code)

getStatesOptions(countryCode: string): Promise<State[]>

Returns a a promise of a list of states (name and code) for the provided countryCode (ISO-3166 alpha-2)

Readme

Keywords

none

Package Sidebar

Install

npm i @vendasta/country-state-sdk

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • vendasta