question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecated your connect method but docs still reference it

See original GitHub issue

General information

  • SDK/Library version: 3.0.0
  • Environment: Production and Sandbox
  • Language, language version, and OS: Node 14.11.0 on macOS 10.15.6

Issue description

On https://developers.braintreepayments.com/start/hello-server/node, the example given is:

var braintree = require("braintree");

var gateway = braintree.connect({
  environment: braintree.Environment.Sandbox,
  merchantId: "useYourMerchantId",
  publicKey: "useYourPublicKey",
  privateKey: "useYourPrivateKey"
});

But in 3.0.0, you deprecated the connect() method according to the CHANGELOG. The CHANGELOG also doesn’t state the method that replaced it.

Can you improve your documentation? Deprecating a method like this without any advance warning creates some risk.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nstuyvesantcommented, Sep 22, 2020

Here’s an example I was able to get working by looking at one of Braintree’s tests…

import braintree from 'braintree';
import config from '../../config/environment';

// Gets a token from Braintree
export async function index(req, res) {
  const gateway = new braintree.BraintreeGateway(config.gateway); // synchronous call

  // Generate the client token
  const { clientToken } = await gateway.clientToken.generate({});
  res.status(200).send(clientToken);
  return clientToken;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to declare or mark a Java method as deprecated?
But still I would like to have it in my API. I just want to show "warning" to anyone using that method. How...
Read more >
Deprecation of Basic authentication in Exchange Online
Simplicity isn't at all bad, but Basic authentication makes it easier ... who still use the old remote PowerShell connection method or the ......
Read more >
Twilio Client JavaScript SDK - Twilio.Connection
A Twilio.Connection object represents a call to or from Twilio. You never instantiate it directly, but it's passed to event handlers and returned...
Read more >
Accessing Google APIs with GoogleApiClient (deprecated)
For example, your app can call methods to read a file from Google Drive regardless of whether your GoogleApiClient instance is connected yet....
Read more >
Deprecated | Android Developers
When a module is deprecated, the use of that module in requires , but not in exports or opens clauses causes a warning...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found