N
Novu•9mo ago
Saruchi

Is there a V0.23.0 of Novu nuget package? for Global preference

How can I use it? i want to use GlobalSubscriberPreference API which was introduced in V0.20 but nuget.org only has versions till V0.3.3 https://www.nuget.org/packages/Novu/0.3.3#show-readme-container
Novu 0.3.3
Novu .NET SDK
15 Replies
Ask Inkeep
Ask Inkeep•9mo ago
Hi @Saruchi, I'm an AI assistant for Novu. While a team member reviews this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @Ask Inkeep with any follow-up questions.
Novu_Bot
Novu_Bot•9mo ago
@Saruchi, you just advanced to level 6!
Ask Inkeep
Ask Inkeep•9mo ago
----------------------------- While I generate an answer, here are some sources that might be helpful: * Discord * Preferences * Kannel * Headless API Reference -----------------------------
Ask Inkeep
Ask Inkeep•9mo ago
Answer To use the GlobalSubscriberPreference API introduced in v0.20 of Novu, you can follow the example provided in the documentation for setting and updating global preferences for a subscriber. Here's how you can do it using Node.js: To get a subscriber's global preference:
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
await novu.subscribers.getGlobalPreference("subscriberId");
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
await novu.subscribers.getGlobalPreference("subscriberId");
(1) To update a subscriber's global preference:
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
await novu.subscribers.updateGlobalPreference("subscriberId", {
enabled: true,
preferences: [{
type: "in_app",
enabled: true
}, {
type: "email",
enabled: false
}]
});
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
await novu.subscribers.updateGlobalPreference("subscriberId", {
enabled: true,
preferences: [{
type: "in_app",
enabled: true
}, {
type: "email",
enabled: false
}]
});
However, it seems there might be a version discrepancy on nuget.org, as you mentioned versions only up to v0.3.3 are listed. The GlobalSubscriberPreference API mentioned above is part of the newer versions of Novu, as indicated by v0.20 in the documentation. For the .NET or NuGet package, ensure you are looking at the correct package or source, as the versioning might differ between different programming language implementations or the package might not be updated yet on nuget.org. If the functionality is not available in the .NET library on NuGet, you might need to use the REST API directly or check if there's an alternative package or pre-release version that supports these features. For the most accurate and updated information, it's recommended to check Novu's official documentation or GitHub repository.
Saruchi
SaruchiOP•9mo ago
Can tou check if this feature is release for .net? @Ask InkeepCan you check if this feature is release for .net?
Ask Inkeep
Ask Inkeep•9mo ago
Thanks for the follow-up, @Saruchi. I'll get back to you soon. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Preferences * Headless API Reference * .NET * Start Point ----------------------------- Answer Sorry, I wasn't able to find any information about your question. Please consider asking a question in our Discord
Pawan Jain
Pawan Jain•9mo ago
cc:- @unicodeveloper
Prosper
Prosper•9mo ago
@todd Please did we ever add this API to the .NET Sdk?
Novu_Bot
Novu_Bot•9mo ago
@unicodeveloper, you just advanced to level 21!
todd
todd•9mo ago
Nope. I haven't made changes since 0.18.x
Saruchi
SaruchiOP•9mo ago
@todd is 0.3.3 the latest Nuget release then? Is there a possibility to add Global preference in near future?
Prosper
Prosper•8mo ago
@todd Please when can we add it? We have a lot of things to add now 😅
todd
todd•8mo ago
Too many and are documented in this ticket https://github.com/novuhq/novu-dotnet/issues/72#issuecomment-1817936788 (which is now further out of date)> I will say that the problem was created by me. I moved the library away from code generated stubs to make the library operate C# idiomatically. It is better to work with but more work to maintain. Also, what I have seen is few are willing to write tests. I have been meaning to do upgrades since Jan and have been struggling to get the time. Aplogies to those that it affects but I am not the only maintainer 🙂
GitHub
Missing methods · Issue #72 · novuhq/novu-dotnet
Some endpoints of the following section can't be hit from this SDK. Please ensure that all the SDK methods are up to date. I'm adding here a list of sections to check/update: Notification t...
todd
todd•8mo ago
@unicodeveloper @dr.really I am currently trying to tame all the version differences such at new versions are no longer difficult to track. I have created what I see as a temporary branch https://github.com/novuhq/novu-dotnet/tree/todd/versioning-differences. Please take a look. chore: tame versioning approach - add local dockerfile with sensible defaults - add openapi diff to see differences between versions - add refitter (script) for auto generation of C# stubs It seems to me that we need to make some decisions: * versioning (revisiting linking back to the production releases in a sensible way) * what version should we back port and make as releases (potentially 6 releases to do—easier than it sounds) * auto generation seems the wrong decision (look at the code) but allows for "easier" updates but really isn't idiomatic Note sure where/how is the best way and what support people want to provide. I have limited time but realise this is a problem for other people if I was them I would pretty annoyed/disappointed.
Prosper
Prosper•8mo ago
@dr.really what do you think?
Want results from more Discord servers?
Add your server