xero-node | Xero Node SDK for OAuth | REST library

 by   XeroAPI TypeScript Version: 6.0.0 License: MIT

kandi X-RAY | xero-node Summary

kandi X-RAY | xero-node Summary

xero-node is a TypeScript library typically used in Web Services, REST, Nodejs applications. xero-node has no vulnerabilities, it has a Permissive License and it has low support. However xero-node has 1965 bugs. You can download it from GitHub.

Xero Node SDK for OAuth 2.0 generated from XeroAPI/Xero-OpenAPI
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              xero-node has a low active ecosystem.
              It has 155 star(s) with 145 fork(s). There are 15 watchers for this library.
              There were 6 major release(s) in the last 12 months.
              There are 21 open issues and 335 have been closed. On average issues are closed in 53 days. There are 5 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of xero-node is 6.0.0

            kandi-Quality Quality

              xero-node has 1965 bugs (0 blocker, 0 critical, 459 major, 1506 minor) and 1037 code smells.

            kandi-Security Security

              xero-node has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              xero-node code analysis shows 0 unresolved vulnerabilities.
              There are 10 security hotspots that need review.

            kandi-License License

              xero-node is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              xero-node releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 98579 lines of code, 0 functions and 546 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of xero-node
            Get all kandi verified functions for this library.

            xero-node Key Features

            No Key Features are available at this moment for xero-node.

            xero-node Examples and Code Snippets

            No Code Snippets are available at this moment for xero-node.

            Community Discussions

            QUESTION

            firebase functions integration with xero-node
            Asked 2020-Sep-30 at 22:59

            Attempting to create a firebase function that is triggered by some database or onRequest event that creates payments on Xero to better manage incoming invoices.

            Not sure I understand how to run (if its possible) the xero-node library from firebase functions.

            I have been messing around with the two and it doesn't seem to be as simple as initialising the object with the secret ID and calling functions like i would expect:

            ...

            ANSWER

            Answered 2020-Sep-29 at 16:50

            EDIT: Ah I think what you need to do is just initialize the client the second time using:

            Source https://stackoverflow.com/questions/64096100

            QUESTION

            Xero-Node undefined Call Back Params
            Asked 2020-Jun-09 at 18:48

            I am using the following: https://github.com/XeroAPI/xero-node

            I am using a React app, talking to a Nodejs backend. The React app calls the node file connect.js as per the below:

            ...

            ANSWER

            Answered 2020-Jun-09 at 17:24

            So the error is because the Xero client has not yet been properly initialized.

            https://github.com/XeroAPI/xero-node/blob/master/src/XeroClient.ts#L99

            As you can see on the code below (linked above) the callbackParams function is a method on the openIdClient ( an oauth2.0 library ) - in order to fully setup they client you will need to call either xero.initialize() or xero.buildConsentUrl() It also looks like you should be passing back the req.url, though the req.body might still work..

            Source https://stackoverflow.com/questions/62287638

            QUESTION

            How you organize the interaction between Angular app and Xero OAuth2.0?
            Asked 2020-May-25 at 23:27

            I am building Angular app that should interact with Xero API. Xero doesn't provide any SDK for Typescript (https://developer.xero.com/documentation/libraries/overview), but Node JS SDK seems to be the most useful lib for my task. But I am in stuck in how to organize the workflow between my app and their https://github.com/XeroAPI/xero-node-oauth2-app . I mean - I'd like to have some advises from the person who has already made similar apps (Angular + Xero) on following questions:
            1) in this guide https://developer.xero.com/documentation/oauth2/auth-flow they say that user should open the page with URL like https://login.xero.com/identity/connect/authorize?... - but is there any way to make user log in without UI? If not -
            2) how this process can be made in my case? In my Angular app I can make a button 'Log in to Xero' that will open new window:

            ...

            ANSWER

            Answered 2020-May-25 at 23:27

            Unfortunately, SPAs are not compatible with the Xero API.

            You'll need a web server to manage your local session (OAuth flow, storage of Xero API tokens), and for your interactions with the Xero API.

            While SPAs are a tempting option (they are convenient from a deployment point of view), there are changes coming to how browsers handle cross-site cookies, which break how SPAs perform session management.

            I'd suggest reading https://leastprivilege.com/2020/03/31/spas-are-dead/ for more information and a discussion of the implications. The authors of the article created OIDC Client JS which is a great library for doing PKCE-based SPA auth in the browser, though it's only useful for same-domain applications now thanks to the impending browser cookie changes.

            Further to this, the Xero API does not support CORS, so even once you complete the OAuth flow, the browser would be prevented from performing API requests from your Angular SPA.

            To answer the specific questions:

            1) The user will need to log in to Xero and grant consent for your app the first time they use your application. If you're storing server-side refresh tokens after the initial consent, your user will only need to log in to your local session, either via Xero SSO or another mechanism (user/password).

            2) To create the initial Authorisation Request, it's best to use the node.js starter app. It will manage the OAuth redirect flow for you (it uses the excellent openid-client open source package for this).

            Source https://stackoverflow.com/questions/61999392

            QUESTION

            Xero API 403 - AuthenticationUnsuccessful error
            Asked 2020-May-21 at 15:53

            I am using the Xero Api with Nodejs and the xero-node library.

            I have completed the oAuth flow and saved the token to the database. The issue i am now having is continually getting a 403 forbidden error when attempting to get anything from Xero be that Contacts, Accounts or Users. Sample code is below

            I can get tenants ok without an issue however anything else doesn't work. I have checked the scopes to make sure when I am setting up the client they are correct which they are.

            ...

            ANSWER

            Answered 2020-May-21 at 15:53

            Which scopes have been added to the access token you are passing through? You can decode your token here https://jwt.io/

            Also - you need to pass the ‘tenant.tenantId’ to the function. I believe the tenant.id actually relates to the connection id which is coming back from the /connections endpoint.

            My hunch is that is the issue. Also curious how that’s working, as updateTenants() should have the empty function call on the end. Is that working for you?

            Source https://stackoverflow.com/questions/61936880

            QUESTION

            Xero SDK - OAuth implementation of state parameter
            Asked 2020-Feb-04 at 23:34

            I have currently implemented a NodeJs, express api with the xero-node sdk package, and I've run into an issue where it doesn't seem that the OAuth state parameter is not being used (though I see it is defined as an optional parameter for the XeroClient constructor:

            ...

            ANSWER

            Answered 2020-Feb-04 at 23:34

            Here is how you pass state through the OAuth flow using the xero-node SDK:

            https://github.com/SerKnight/xero-node-basic-app/blob/master/index.js#L37

            Example:

            • first generate the consentUrl, then append your custom params.

            Source https://stackoverflow.com/questions/59994037

            QUESTION

            Integration Xero in ReactJS application causes errors
            Asked 2020-Jan-06 at 19:11

            I am working on a Xero integration and am having some issues setting up the XeroClient from the SDK. We are currently working in a React app written with Typescript.

            Currently I am importing Xero SDK like this:

            ...

            ANSWER

            Answered 2020-Jan-06 at 19:11

            Currently the xero-node project requires a backend to authenticate.. Is this a react SPA, or you are just setting up the API calls in the component?

            Will OAuth 2.0 support desktop/mobile/single-page apps that can’t keep a client secret confidential?

            At the moment, we require that your app can keep a client secret confidential. We are currently evaluating the PKCE extension to better support SPAs and mobile apps.

            https://developer.xero.com/faq/oauth2/oauth-non-secret

            Your Console error looks like its just the Unused vars expression.. Here is some context on what that is ( https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md )

            Your Secondary browser error makes me think that you are using an older version of Node.. We need to add an .npmrc that forces a supported node version - are you using an older Node VSN?

            Source https://stackoverflow.com/questions/59560642

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install xero-node

            To install this SDK in your project:.

            Support

            This SDK supports full method coverage for the following Xero API sets:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i xero-node

          • CLONE
          • HTTPS

            https://github.com/XeroAPI/xero-node.git

          • CLI

            gh repo clone XeroAPI/xero-node

          • sshUrl

            git@github.com:XeroAPI/xero-node.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link