You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Paystack Typescript import not constructable #4
@orimdominic we've just published the fix to this issue in PR #6. Kindly upgrade to v1.0.1 and try again. You might get an error about the resource (e.g transaction) not being a type of paystack, but that's just a typing error that can be ignored for now. I'll work on the types in another PR.
Sincere apologies for the delay here. Q1 planning and setting up for the year pushed this further down the backlog. However, it's been prioritised now and we'll push a permanent fix in early Q2.
Hello @damilola-paystack Is there any resolution on this?
I am having the same issue that @waptik and @dubems are having
For context, here is information you may need and if you need more, you can make a request.
Hey folks, apologizing right now is literally rubbing salt on injury. For some reason, the notifications from this thread wasn't getting to our internal tool. I've assigned the issue to myself and will pick up work on it.
Hello @damilola-paystack, I have tested this with @paystack/paystack-sdk@1.2.1-beta.1 and can confirm that the error does not come up with Typescript 5.5.2 🚀 💪🏽 🙌🏽
However, I do not get suggestions for methods and fields from the paystack object when created
import{Paystack}from'@paystack/paystack-sdk'constp=newPaystack("you-cant-see-me")p.// no suggestions for methods like `charge` and `customer`
Thanks for the feedback @orimdominic. Yeah, I noticed the types aren't built after compilation. This is being looked into but we want to ensure the SDK is stable and usable first.
@damilola-paystack I tested with @paystack/paystack-sdk": "^1.2.1-beta.1 version using CommonJS where I get this error { status: undefined, message: "'sk_test_XXXXXX' not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer sk_test_XXXXXX'.", data: undefined }
@damilola-paystack I tested with @paystack/paystack-sdk": "^1.2.1-beta.1 version using CommonJS where I get this error { status: undefined, message: "'sk_test_XXXXXX' not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer sk_test_XXXXXX'.", data: undefined }
Hi @damilola-paystack , I ran into the same Paystack is not a constructor error. I was only able to fix it after stumbling on this thread and installing @npm i @paystack/paystack-sdk@1.2.1-beta.1.
The problem is that the fix currently only lives in a pre-release, so the documented npm install @paystack/paystack-sdk still pulls the older broken build. Anyone who doesn't find this issue hits the error with no obvious way out.
Would it be possible to promote this to a stable release so new users get the fix from the default install?
Activity
damilola-paystack commentedon Oct 25, 2022
Hi @orimdominic, thanks for providing context on this bug. I'll try to replicate it on my end and get back to you
damilola-paystack commentedon Oct 28, 2022
Hi @orimdominic I've been able to replicate the bug. We'll work on a fix and push it out as soon as possible.
damilola-paystack commentedon Nov 1, 2022
@orimdominic we've just published the fix to this issue in PR #6. Kindly upgrade to v1.0.1 and try again. You might get an error about the resource (e.g transaction) not being a type of
paystack, but that's just a typing error that can be ignored for now. I'll work on the types in another PR.waptik commentedon Nov 1, 2022
I'm still getting a type error when importing even after upgrading to v1.0.1

damilola-paystack commentedon Nov 23, 2022
Hey @waptik I somehow missed this. Are you still getting this error? Should the issue be reopened?
waptik commentedon Nov 23, 2022
Yes ooo, i am still getting that error. I think it should be reopened since it occurs at the import level
damilola-paystack commentedon Nov 23, 2022
Can you share what your
tsconfiglooks like?dubems commentedon Mar 15, 2023
Bumping this up again....
I still have this issue despite using the v1.0.1
This is what my tsconfig looks like
cc: @damilola-paystack
damilola-paystack commentedon Mar 30, 2023
Sincere apologies for the delay here. Q1 planning and setting up for the year pushed this further down the backlog. However, it's been prioritised now and we'll push a permanent fix in early Q2.
daudujohn commentedon Sep 14, 2023
Hi, are there still any plans to fix this issue?
orimdominic commentedon Nov 19, 2023
Hello @damilola-paystack Is there any resolution on this?
I am having the same issue that @waptik and @dubems are having
For context, here is information you may need and if you need more, you can make a request.
Editor: VSCode 1.82.1
Node.js version: v20.9.0
Typescript version: ^4.9.5
R4heem-Orekoya commentedon Jan 28, 2024
Please when is this issue going to be fixed?😓
1 remaining item
damilola-paystack commentedon Jun 3, 2024
Hey folks, apologizing right now is literally rubbing salt on injury. For some reason, the notifications from this thread wasn't getting to our internal tool. I've assigned the issue to myself and will pick up work on it.
damilola-paystack commentedon Jun 25, 2024
Hi @ogheneovo12 @orimdominic @R4heem-Orekoya @daudujohn thanks for the patience so far. A beta release has been published, which can be gotten by running:
npm i @paystack/paystack-sdk@1.2.1-beta.1Kindly help test and share your feedback.
PS: We've now switched to named export which means you'd now need to use curly braces to access the Paystack class i.e.
import { Paystack } from '@paystack/paystack-sdk'for ESM orconst { Paystack } = require('@paystack/paystack-sdk')for CJSLooking forward to your feedback.
orimdominic commentedon Jun 26, 2024
Hello @damilola-paystack, I have tested this with
@paystack/paystack-sdk@1.2.1-beta.1and can confirm that the error does not come up with Typescript5.5.2🚀 💪🏽 🙌🏽However, I do not get suggestions for methods and fields from the paystack object when created
damilola-paystack commentedon Jun 26, 2024
Thanks for the feedback @orimdominic. Yeah, I noticed the types aren't built after compilation. This is being looked into but we want to ensure the SDK is stable and usable first.
steve-jr commentedon Aug 8, 2024
@damilola-paystack I tested with
@paystack/paystack-sdk": "^1.2.1-beta.1version using CommonJS where I get this error{ status: undefined, message: "'sk_test_XXXXXX' not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer sk_test_XXXXXX'.", data: undefined }when initializing the paystack object.
Here is a code snippet
damilola-paystack commentedon Aug 12, 2024
Hey @steve-jr it seems you didn't complete typing out your feedback. Can you try update so we understand what the issue is?
steve-jr commentedon Aug 13, 2024
@damilola-paystack It is updated now.
damilola-paystack commentedon Aug 15, 2024
This is strange @steve-jr. I tried replicating to no avail. Can you try making a direct API call in the same project without using the library?
gray-adeyi commentedon Sep 19, 2024
Hi! try out this package. It's not yet a major release but it supports typescript and other JavaScript runtime like bun and Deno https://www.npmjs.com/package/@gray-adeyi/paystack-sdk
gray-adeyi commentedon Dec 14, 2024
@gray-adeyi/paystack-sdk 0.2.4 release is now available with even better type support 🔥 https://www.npmjs.com/package/@gray-adeyi/paystack-sdk
joshysmart commentedon Jun 29, 2025
This is still an issue
gloriadasilva commentedon Aug 11, 2026
Hi @damilola-paystack , I ran into the same
Paystack is not a constructorerror. I was only able to fix it after stumbling on this thread and installing@npm i @paystack/paystack-sdk@1.2.1-beta.1.The problem is that the fix currently only lives in a pre-release, so the documented
npm install @paystack/paystack-sdkstill pulls the older broken build. Anyone who doesn't find this issue hits the error with no obvious way out.Would it be possible to promote this to a stable release so new users get the fix from the default install?
damilola-paystack commentedon Aug 24, 2026
Thanks for bubbling this up again @gloriadasilva. We've bumped up the beta release to the main one.